Skip to content

Commit

Permalink
Remove some unused functions and methods
Browse files Browse the repository at this point in the history
In the case of CKey's destructor, it seems to have been an oversight in
f4d1fc2 not to delete it. At this point, it results in the move
constructors/assignment operators for CKey being deleted, which may have
a performance impact.
  • Loading branch information
sipa committed Sep 22, 2017
1 parent 6c4fecf commit 46c9043
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 21 deletions.
14 changes: 0 additions & 14 deletions src/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,6 @@ inline uint256 Hash(const T1 p1begin, const T1 p1end,
return result;
}

/** Compute the 256-bit hash of the concatenation of three objects. */
template<typename T1, typename T2, typename T3>
inline uint256 Hash(const T1 p1begin, const T1 p1end,
const T2 p2begin, const T2 p2end,
const T3 p3begin, const T3 p3end) {
static const unsigned char pblank[1] = {};
uint256 result;
CHash256().Write(p1begin == p1end ? pblank : (const unsigned char*)&p1begin[0], (p1end - p1begin) * sizeof(p1begin[0]))
.Write(p2begin == p2end ? pblank : (const unsigned char*)&p2begin[0], (p2end - p2begin) * sizeof(p2begin[0]))
.Write(p3begin == p3end ? pblank : (const unsigned char*)&p3begin[0], (p3end - p3begin) * sizeof(p3begin[0]))
.Finalize((unsigned char*)&result);
return result;
}

/** Compute the 160-bit hash an object. */
template<typename T1>
inline uint160 Hash160(const T1 pbegin, const T1 pend)
Expand Down
5 changes: 0 additions & 5 deletions src/key.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ class CKey
keydata.resize(32);
}

//! Destructor (again necessary because of memlocking).
~CKey()
{
}

friend bool operator==(const CKey& a, const CKey& b)
{
return a.fCompressed == b.fCompressed &&
Expand Down
2 changes: 0 additions & 2 deletions src/uint256.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ class base_blob
class uint160 : public base_blob<160> {
public:
uint160() {}
explicit uint160(const base_blob<160>& b) : base_blob<160>(b) {}
explicit uint160(const std::vector<unsigned char>& vch) : base_blob<160>(vch) {}
};

Expand All @@ -123,7 +122,6 @@ class uint160 : public base_blob<160> {
class uint256 : public base_blob<256> {
public:
uint256() {}
explicit uint256(const base_blob<256>& b) : base_blob<256>(b) {}
explicit uint256(const std::vector<unsigned char>& vch) : base_blob<256>(vch) {}

/** A cheap hash function that just returns 64 bits from the result, it can be
Expand Down

0 comments on commit 46c9043

Please sign in to comment.