]> git.lizzy.rs Git - enumset.git/commitdiff
Fix minor efficiency issue.
authorLymia Aluysia <lymia@lymiahugs.com>
Fri, 25 May 2018 14:41:12 +0000 (09:41 -0500)
committerLymia Aluysia <lymia@lymiahugs.com>
Fri, 25 May 2018 14:41:12 +0000 (09:41 -0500)
src/lib.rs

index 6d79c7ee7b04630286ab09f3e40fc13b9ca1bcde..9e82f7c64dfffb5a1e58d7b1b942bd7cb1afa565 100644 (file)
@@ -220,7 +220,7 @@ impl <T : EnumSetType> EnumSet<T> {
     }
     /// Returns a set with all elements of the other set removed.
     pub fn difference(&self, other: Self) -> Self {
-        *self & !other
+        EnumSet { __enumset_underlying: self.__enumset_underlying & !other.__enumset_underlying }
     }
     /// Returns a set with all elements not contained in both sets.
     pub fn symmetrical_difference(&self, other: Self) -> Self {