enum_set: Fix bool performance warning.
authorJamie Madill <jmadill@chromium.org>
Thu, 27 Oct 2016 20:09:06 +0000 (16:09 -0400)
committerJamie Madill <jmadill@chromium.org>
Thu, 27 Oct 2016 20:09:06 +0000 (16:09 -0400)
Implicit casts from int to bool cause a warning in visual studio.

source/enum_set.h

index 2ca6251..6f9be32 100644 (file)
@@ -84,7 +84,7 @@ class EnumSet {
   bool Contains(uint32_t word) const {
     // We shouldn't call Overflow() since this is a const method.
     if (auto bits = AsMask(word)) {
-      return mask_ & bits;
+      return (mask_ & bits) != 0;
     } else if (auto overflow = overflow_.get()) {
       return overflow->find(word) != overflow->end();
     }