From c763a4087f1d8fa4dbdfb9c8f30d545cdb66a0aa Mon Sep 17 00:00:00 2001 From: Julian Büning Date: Sat, 10 Oct 2020 15:13:06 +0200 Subject: Ref: implement operator bool() --- lib/Expr/Updates.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/Expr/Updates.cpp') 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 &_next, const ref &_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; } -- cgit 1.4.1