From fc05768374ac839e7725506fe0a089fc2bfdf124 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 22 Oct 2013 00:41:57 +0200 Subject: Queue: add method ModifyAtPosition() --- src/Queue.cxx | 2 +- src/Queue.hxx | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Queue.cxx b/src/Queue.cxx index ea93e8157..017dfefc3 100644 --- a/src/Queue.cxx +++ b/src/Queue.cxx @@ -82,7 +82,7 @@ queue::ModifyAtOrder(unsigned _order) assert(_order < length); unsigned position = order[_order]; - items[position].version = version; + ModifyAtPosition(position); } void diff --git a/src/Queue.hxx b/src/Queue.hxx index e3a66f3a8..d5b9218a5 100644 --- a/src/Queue.hxx +++ b/src/Queue.hxx @@ -240,6 +240,17 @@ struct queue { */ void IncrementVersion(); + /** + * Marks the specified song as "modified". Call + * IncrementVersion() after all modifications have been made. + * number. + */ + void ModifyAtPosition(unsigned position) { + assert(position < length); + + items[position].version = version; + } + /** * Marks the specified song as "modified". Call * IncrementVersion() after all modifications have been made. -- cgit v1.2.3