From 785d762d4f5d69e3c89855f68cb0654aace4608d Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Mon, 2 Jul 2012 17:44:17 +1000 Subject: Dependency-aware smart fixpoint. Slows it down *heaps* for the moment. Still need to add the MaxStrategy part, which should speed it up a fair bit. At the moment it has to do a fair bit more work for no benefit. --- impl/IdSet.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'impl/IdSet.hpp') diff --git a/impl/IdSet.hpp b/impl/IdSet.hpp index 2ba88d3..f845325 100644 --- a/impl/IdSet.hpp +++ b/impl/IdSet.hpp @@ -45,6 +45,12 @@ class IdSet { return *this; } + void invert() { + for (unsigned int i = 0; i < DIV_ROUND_UP(_length, CELL_SIZE); ++i) { + _values[i] = ~_values[i]; + } + } + bool contains(const T& obj) const { unsigned int id = obj.id(); if (id >= _length) { @@ -125,7 +131,8 @@ class IdSet { do { index++; for (;; index += CELL_SIZE) { - if (index == set._length) { + if (index >= set._length) { + index = set._length; return *this; } cell = index / CELL_SIZE; -- cgit v1.2.3