summaryrefslogtreecommitdiff
path: root/queue.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2015-07-30 13:24:37 -0400
committerJeffrey Walton <noloader@gmail.com>2015-07-30 13:24:37 -0400
commit8293570bd454d978ae0653826655a4aa559e352e (patch)
tree268823741a0e1fc80017cc66fff4057881299838 /queue.cpp
parent77206baf56e6feb111f54678038307ac216128d5 (diff)
downloadcryptopp-git-8293570bd454d978ae0653826655a4aa559e352e.tar.gz
Added self-assignment guards or comment indicating why the check is not needed
Diffstat (limited to 'queue.cpp')
-rw-r--r--queue.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/queue.cpp b/queue.cpp
index 3beb731c..4a319cb5 100644
--- a/queue.cpp
+++ b/queue.cpp
@@ -428,17 +428,17 @@ byte * ByteQueue::CreatePutSpace(size_t &size)
ByteQueue & ByteQueue::operator=(const ByteQueue &rhs)
{
- if (this == &rhs) return *this;
-
- Destroy();
- CopyFrom(rhs);
+ if (this != &rhs)
+ {
+ Destroy();
+ CopyFrom(rhs);
+ }
return *this;
}
bool ByteQueue::operator==(const ByteQueue &rhs) const
{
const lword currentSize = CurrentSize();
-
if (currentSize != rhs.CurrentSize())
return false;