2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-19 16:32:16 +00:00

Move high_bound predecrement out of loop in adjustIndexesReverse

[SVN r20342]
This commit is contained in:
Raoul Gough
2003-10-10 21:12:15 +00:00
parent 125d2084df
commit 05dd7bf52a

View File

@@ -507,12 +507,11 @@ namespace boost { namespace python { namespace indexing {
while (low_bound != high_bound)
{
MapIterator next (low_bound);
++next; // Find next node before erasing the current target
MapIterator target (low_bound);
adjustIndex (low_bound, offset);
++low_bound; // Find next node before erasing the current target
low_bound = next;
adjustIndex (target, offset);
}
}
@@ -523,24 +522,26 @@ namespace boost { namespace python { namespace indexing {
, MapIterator high_bound
, long offset)
{
while (low_bound != high_bound)
if (low_bound != high_bound)
{
--high_bound; // Adjust now because high_bound is one-past-the-end
if (high_bound == low_bound)
while (true)
{
adjustIndex (high_bound, offset); // Last one to adjust
}
if (high_bound == low_bound)
{
adjustIndex (high_bound, offset); // Last one to adjust
break;
}
else
{
MapIterator temp (high_bound);
--temp; // Find previous node before doing erase
else
{
MapIterator target (high_bound);
adjustIndex (high_bound, offset); // Do erase
--high_bound; // Find previous node before doing erase
high_bound = temp;
++high_bound; // Make one-past-the-end again
adjustIndex (target, offset); // Do erase
}
}
}
}