std.algorithm.remove: Change pop____N to pop____Exactly

This commit is contained in:
safety0ff 2014-07-02 19:57:27 -04:00
parent 93068b15bd
commit b54f32eee6

View file

@ -8581,7 +8581,7 @@ if (s != SwapStrategy.stable
// Look for a blackout on the right // Look for a blackout on the right
if (blackouts[right].pos + blackouts[right].len >= range.length) if (blackouts[right].pos + blackouts[right].len >= range.length)
{ {
range.popBackN(blackouts[right].len); range.popBackExactly(blackouts[right].len);
// Since right is unsigned, we must check for this case, otherwise // Since right is unsigned, we must check for this case, otherwise
// we might turn it into size_t.max and the loop condition will not // we might turn it into size_t.max and the loop condition will not
@ -8596,7 +8596,7 @@ if (s != SwapStrategy.stable
} }
// Advance to next blackout on the left // Advance to next blackout on the left
assert(blackouts[left].pos >= steps); assert(blackouts[left].pos >= steps);
tgt.popFrontN(blackouts[left].pos - steps); tgt.popFrontExactly(blackouts[left].pos - steps);
steps = blackouts[left].pos; steps = blackouts[left].pos;
auto toMove = min( auto toMove = min(
blackouts[left].len, blackouts[left].len,
@ -8655,13 +8655,13 @@ if (s == SwapStrategy.stable
} }
else else
{ {
src.popFrontN(from); src.popFrontExactly(from);
tgt.popFrontN(from); tgt.popFrontExactly(from);
pos = from; pos = from;
} }
// now skip source to the "to" position // now skip source to the "to" position
src.popFrontN(delta); src.popFrontExactly(delta);
result.popBackN(delta); result.popBackExactly(delta);
pos += delta; pos += delta;
} }
// leftover move // leftover move