From 6936c0e2abc4e50db169e5c034bd9fb4dab04d0c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 6 Jan 2013 23:44:59 +0100 Subject: Queue: use std::swap --- src/Queue.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/Queue.cxx') diff --git a/src/Queue.cxx b/src/Queue.cxx index f64bbf5c9..1b329e485 100644 --- a/src/Queue.cxx +++ b/src/Queue.cxx @@ -145,13 +145,10 @@ queue::Append(struct song *song, uint8_t priority) void queue::SwapPositions(unsigned position1, unsigned position2) { - struct queue_item tmp; unsigned id1 = items[position1].id; unsigned id2 = items[position2].id; - tmp = items[position1]; - items[position1] = items[position2]; - items[position2] = tmp; + std::swap(items[position1], items[position2]); items[position1].version = version; items[position2].version = version; -- cgit v1.2.3