summaryrefslogtreecommitdiff
path: root/src/Piece.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-11-12 12:48:48 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-11-12 12:48:48 +0000
commit93e5dbed325f29c1bf867a2847d3b839d545cfb2 (patch)
treef657b55b41a05cf364403a36edf9d0921f426e7d /src/Piece.cc
parentf6f5a7e5eeec4f14418fec5a7be1bbe57a7ea7e1 (diff)
2010-11-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed SharedHandle::isNull(). Instead we added operator* and operator unspecified_bool_type. Removed use of WeakHandle and replaced with raw pointer.
Diffstat (limited to 'src/Piece.cc')
-rw-r--r--src/Piece.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Piece.cc b/src/Piece.cc
index c4e7f770..c7fe2c06 100644
--- a/src/Piece.cc
+++ b/src/Piece.cc
@@ -200,7 +200,7 @@ bool Piece::updateHash
return false;
}
if(begin == nextBegin_ && nextBegin_+dataLength <= length_) {
- if(mdctx_.isNull()) {
+ if(!mdctx_) {
mdctx_ = MessageDigest::create(hashAlgo_);
}
mdctx_->update(data, dataLength);
@@ -213,12 +213,12 @@ bool Piece::updateHash
bool Piece::isHashCalculated() const
{
- return !mdctx_.isNull() && nextBegin_ == length_;
+ return mdctx_ && nextBegin_ == length_;
}
std::string Piece::getHashString()
{
- if(mdctx_.isNull()) {
+ if(!mdctx_) {
return A2STR::NIL;
} else {
std::string hash = mdctx_->hexDigest();