diff options
author | Max Kellermann <max@duempel.org> | 2013-01-08 16:33:33 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-08 16:33:33 +0100 |
commit | 8ef87be4829a260893ababa1ff943a8cf1afa0b2 (patch) | |
tree | 5a40ac9df2c2e4d62294bb82520c46571c18d3e9 /src/Queue.cxx | |
parent | 6c57047362ce8ae26b3d468d85bbdf2516e521a5 (diff) | |
download | mpd-8ef87be4829a260893ababa1ff943a8cf1afa0b2.tar.gz mpd-8ef87be4829a260893ababa1ff943a8cf1afa0b2.tar.xz mpd-8ef87be4829a260893ababa1ff943a8cf1afa0b2.zip |
Queue: use signed integer instead of G_MAXUINT
The check for unsigned underflow is fragile and unreliable.
Diffstat (limited to '')
-rw-r--r-- | src/Queue.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Queue.cxx b/src/Queue.cxx index 34f891262..0c2a8fc9f 100644 --- a/src/Queue.cxx +++ b/src/Queue.cxx @@ -181,7 +181,7 @@ queue::MoveRange(unsigned start, unsigned end, unsigned to) // If to < start, we need to move start-to items to newend (= end + to - start), starting from to // This is the same as moving items from start-1 to to (decreasing), with start-1 going to end-1 // We have to iterate in this order to avoid writing over something we haven't yet moved - for (unsigned i = start - 1; i >= to && i != G_MAXUINT; i--) + for (int i = start - 1; i >= int(to); i--) MoveItemTo(i, i + end - start); // Copy the original block back in, starting at to. |