summaryrefslogtreecommitdiff
path: root/separate_rects.h
diff options
context:
space:
mode:
Diffstat (limited to 'separate_rects.h')
-rw-r--r--separate_rects.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/separate_rects.h b/separate_rects.h
index de8b660..cb46ecb 100644
--- a/separate_rects.h
+++ b/separate_rects.h
@@ -105,6 +105,14 @@ struct IdSet {
bitset &= ~(((TUInt)1) << id);
}
+ void subtract(TId start, TId end) {
+ if (start > end)
+ return;
+ TId start_mask = (1 << start) - 1;
+ TId end_mask = (1 << end) - 1;
+ bitset &= ~(start_mask ^ end_mask);
+ }
+
bool isEmpty() const {
return bitset == 0;
}