summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llcommon/llinstancetracker.h10
-rw-r--r--indra/llcommon/tests/llinstancetracker_test.cpp16
2 files changed, 7 insertions, 19 deletions
diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h
index 1ac6629f8a..47041f790f 100644
--- a/indra/llcommon/llinstancetracker.h
+++ b/indra/llcommon/llinstancetracker.h
@@ -73,12 +73,12 @@ public:
void increment() { mIterator++; }
bool equal(instance_iter const& other) const
{
- return mIterator == other.m_iterator;
+ return mIterator == other.mIterator;
}
T& dereference() const
{
- return mIterator->second;
+ return *(mIterator->second);
}
typename InstanceMap::iterator mIterator;
@@ -102,14 +102,14 @@ public:
friend class boost::iterator_core_access;
void increment() { mIterator++; }
- bool equal(instance_iter const& other) const
+ bool equal(key_iter const& other) const
{
- return mIterator == other.m_iterator;
+ return mIterator == other.mIterator;
}
KEY& dereference() const
{
- return mIterator->first;
+ return const_cast<KEY&>(mIterator->first);
}
typename InstanceMap::iterator mIterator;
diff --git a/indra/llcommon/tests/llinstancetracker_test.cpp b/indra/llcommon/tests/llinstancetracker_test.cpp
index af55341e1f..73cbd76d91 100644
--- a/indra/llcommon/tests/llinstancetracker_test.cpp
+++ b/indra/llcommon/tests/llinstancetracker_test.cpp
@@ -151,25 +151,13 @@ namespace tut
{
Unkeyed one, two, three;
typedef std::set<Unkeyed*> KeySet;
- KeySet keys;
- keys.insert(&one);
- keys.insert(&two);
- keys.insert(&three);
- {
- for (Unkeyed::key_iter ki(beginKeys()), kend(endKeys());
- ki != kend; ++ki)
- {
- ensure_equals("spurious key", keys.erase(*ki), 1);
- }
- }
- ensure_equals("unreported key", keys.size(), 0);
-
+
KeySet instances;
instances.insert(&one);
instances.insert(&two);
instances.insert(&three);
{
- for (Unkeyed::instance_iter ii(beginInstances()), iend(endInstances()); ii != iend; ++ii)
+ for (Unkeyed::instance_iter ii(Unkeyed::beginInstances()), iend(Unkeyed::endInstances()); ii != iend; ++ii)
{
Unkeyed& ref = *ii;
ensure_equals("spurious instance", instances.erase(&ref), 1);