Skip to content

Commit 7ddf2ff

Browse files
kwvgPastaPastaPasta
authored andcommitted
refactor: remove unused Hash function variants
The three object variant was removed in dash#3276 through the backport of bitcoin#11385, leaving behind the four, five and six variant options. They aren't used anywhere in the codebase and aren't present in Bitcoin Core currently, and so, have been removed.
1 parent 35f1c94 commit 7ddf2ff

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

src/hash.h

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -106,60 +106,6 @@ inline uint256 Hash(const T1 p1begin, const T1 p1end,
106106
return result;
107107
}
108108

109-
/** Compute the 256-bit hash of the concatenation of three objects. */
110-
template<typename T1, typename T2, typename T3, typename T4>
111-
inline uint256 Hash(const T1 p1begin, const T1 p1end,
112-
const T2 p2begin, const T2 p2end,
113-
const T3 p3begin, const T3 p3end,
114-
const T4 p4begin, const T4 p4end) {
115-
static const unsigned char pblank[1] = {};
116-
uint256 result;
117-
CHash256().Write(p1begin == p1end ? pblank : (const unsigned char*)&p1begin[0], (p1end - p1begin) * sizeof(p1begin[0]))
118-
.Write(p2begin == p2end ? pblank : (const unsigned char*)&p2begin[0], (p2end - p2begin) * sizeof(p2begin[0]))
119-
.Write(p3begin == p3end ? pblank : (const unsigned char*)&p3begin[0], (p3end - p3begin) * sizeof(p3begin[0]))
120-
.Write(p4begin == p4end ? pblank : (const unsigned char*)&p4begin[0], (p4end - p4begin) * sizeof(p4begin[0]))
121-
.Finalize((unsigned char*)&result);
122-
return result;
123-
}
124-
125-
/** Compute the 256-bit hash of the concatenation of three objects. */
126-
template<typename T1, typename T2, typename T3, typename T4, typename T5>
127-
inline uint256 Hash(const T1 p1begin, const T1 p1end,
128-
const T2 p2begin, const T2 p2end,
129-
const T3 p3begin, const T3 p3end,
130-
const T4 p4begin, const T4 p4end,
131-
const T5 p5begin, const T5 p5end) {
132-
static const unsigned char pblank[1] = {};
133-
uint256 result;
134-
CHash256().Write(p1begin == p1end ? pblank : (const unsigned char*)&p1begin[0], (p1end - p1begin) * sizeof(p1begin[0]))
135-
.Write(p2begin == p2end ? pblank : (const unsigned char*)&p2begin[0], (p2end - p2begin) * sizeof(p2begin[0]))
136-
.Write(p3begin == p3end ? pblank : (const unsigned char*)&p3begin[0], (p3end - p3begin) * sizeof(p3begin[0]))
137-
.Write(p4begin == p4end ? pblank : (const unsigned char*)&p4begin[0], (p4end - p4begin) * sizeof(p4begin[0]))
138-
.Write(p5begin == p5end ? pblank : (const unsigned char*)&p5begin[0], (p5end - p5begin) * sizeof(p5begin[0]))
139-
.Finalize((unsigned char*)&result);
140-
return result;
141-
}
142-
143-
/** Compute the 256-bit hash of the concatenation of three objects. */
144-
template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
145-
inline uint256 Hash(const T1 p1begin, const T1 p1end,
146-
const T2 p2begin, const T2 p2end,
147-
const T3 p3begin, const T3 p3end,
148-
const T4 p4begin, const T4 p4end,
149-
const T5 p5begin, const T5 p5end,
150-
const T6 p6begin, const T6 p6end) {
151-
static const unsigned char pblank[1] = {};
152-
uint256 result;
153-
CHash256().Write(p1begin == p1end ? pblank : (const unsigned char*)&p1begin[0], (p1end - p1begin) * sizeof(p1begin[0]))
154-
.Write(p2begin == p2end ? pblank : (const unsigned char*)&p2begin[0], (p2end - p2begin) * sizeof(p2begin[0]))
155-
.Write(p3begin == p3end ? pblank : (const unsigned char*)&p3begin[0], (p3end - p3begin) * sizeof(p3begin[0]))
156-
.Write(p4begin == p4end ? pblank : (const unsigned char*)&p4begin[0], (p4end - p4begin) * sizeof(p4begin[0]))
157-
.Write(p5begin == p5end ? pblank : (const unsigned char*)&p5begin[0], (p5end - p5begin) * sizeof(p5begin[0]))
158-
.Write(p6begin == p6end ? pblank : (const unsigned char*)&p6begin[0], (p6end - p6begin) * sizeof(p6begin[0]))
159-
.Finalize((unsigned char*)&result);
160-
return result;
161-
}
162-
163109
/** Compute the 160-bit hash an object. */
164110
template<typename T1>
165111
inline uint160 Hash160(const T1 pbegin, const T1 pend)

0 commit comments

Comments
 (0)