From eaea15e4a146b777a47d39fa708ce7b9b18e64d4 Mon Sep 17 00:00:00 2001 From: Thinkofname Date: Fri, 18 Mar 2016 10:25:09 +0000 Subject: [PATCH] Allow searching for entities within the manager --- protocol/src/types/bit/set.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/protocol/src/types/bit/set.rs b/protocol/src/types/bit/set.rs index 23ef4e8..0a620ad 100644 --- a/protocol/src/types/bit/set.rs +++ b/protocol/src/types/bit/set.rs @@ -41,6 +41,10 @@ impl Set { self.data.resize((new_size + 63) / 64, 0); } + pub fn capacity(&self) -> usize { + self.data.len() * 64 + } + pub fn set(&mut self, i: usize, v: bool) { if v { self.data[i >> 6] |= 1 << (i & 0x3F) @@ -54,7 +58,6 @@ impl Set { } pub fn includes_set(&self, other: &Set) -> bool { - debug_assert!(self.data.len() == other.data.len()); for (a, b) in self.data.iter().zip(&other.data) { if a & b != *b { return false;