about summary refs log tree commit diff homepage
path: root/lib/Expr/Updates.cpp
diff options
context:
space:
mode:
authorJulian Büning <julian.buening@rwth-aachen.de>2020-10-10 15:13:06 +0200
committerCristian Cadar <c.cadar@imperial.ac.uk>2020-11-12 10:13:54 +0000
commitc763a4087f1d8fa4dbdfb9c8f30d545cdb66a0aa (patch)
tree5d40c27ecfb16230aa3e714a3e7690b44b322860 /lib/Expr/Updates.cpp
parentacdb9a692d9eee8dd102befa4e101bfa5f028b0e (diff)
downloadklee-c763a4087f1d8fa4dbdfb9c8f30d545cdb66a0aa.tar.gz
Ref: implement operator bool()
Diffstat (limited to 'lib/Expr/Updates.cpp')
-rw-r--r--lib/Expr/Updates.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Expr/Updates.cpp b/lib/Expr/Updates.cpp
index 4734f592..0ac832ad 100644
--- a/lib/Expr/Updates.cpp
+++ b/lib/Expr/Updates.cpp
@@ -25,7 +25,7 @@ UpdateNode::UpdateNode(const ref<UpdateNode> &_next, const ref<Expr> &_index,
          "Update value should be 8-bit wide.");
   */
   computeHash();
-  size = next.isNull() ? 1 : 1 + next->size;
+  size = next ? next->size + 1 : 1;
 }
 
 extern "C" void vc_DeleteExpr(void*);
@@ -38,7 +38,7 @@ int UpdateNode::compare(const UpdateNode &b) const {
 
 unsigned UpdateNode::computeHash() {
   hashValue = index->hash() ^ value->hash();
-  if (!next.isNull())
+  if (next)
     hashValue ^= next->hash();
   return hashValue;
 }
@@ -88,7 +88,7 @@ unsigned UpdateList::hash() const {
   unsigned res = 0;
   for (unsigned i = 0, e = root->name.size(); i != e; ++i)
     res = (res * Expr::MAGIC_HASH_CONSTANT) + root->name[i];
-  if (head.get())
+  if (head)
     res ^= head->hash();
   return res;
 }