aboutsummaryrefslogtreecommitdiffstats
path: root/src/queue/QueueSave.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-11-11 15:34:36 +0100
committerMax Kellermann <max@duempel.org>2015-11-11 15:34:36 +0100
commit738583e3d4cd7a35aec545448f86a8c097768785 (patch)
tree67e0ed29ea1aa6c44ccaa7de1b5297715bc06f43 /src/queue/QueueSave.cxx
parentc513478c31c8543309da5f04bb472ea6e4969603 (diff)
downloadmpd-738583e3d4cd7a35aec545448f86a8c097768785.tar.gz
mpd-738583e3d4cd7a35aec545448f86a8c097768785.tar.xz
mpd-738583e3d4cd7a35aec545448f86a8c097768785.zip
StateFile: use StringAfterPrefix() instead of StringStartsWith()
Diffstat (limited to 'src/queue/QueueSave.cxx')
-rw-r--r--src/queue/QueueSave.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/queue/QueueSave.cxx b/src/queue/QueueSave.cxx
index cb8611cf8..3b9589450 100644
--- a/src/queue/QueueSave.cxx
+++ b/src/queue/QueueSave.cxx
@@ -83,8 +83,9 @@ queue_load_song(TextFile &file, const SongLoader &loader,
return;
uint8_t priority = 0;
- if (StringStartsWith(line, PRIO_LABEL)) {
- priority = strtoul(line + sizeof(PRIO_LABEL) - 1, nullptr, 10);
+ const char *p;
+ if ((p = StringAfterPrefix(line, PRIO_LABEL))) {
+ priority = strtoul(p, nullptr, 10);
line = file.ReadLine();
if (line == nullptr)
@@ -93,8 +94,8 @@ queue_load_song(TextFile &file, const SongLoader &loader,
DetachedSong *song;
- if (StringStartsWith(line, SONG_BEGIN)) {
- const char *uri = line + sizeof(SONG_BEGIN) - 1;
+ if ((p = StringAfterPrefix(line, PRIO_LABEL))) {
+ const char *uri = p;
Error error;
song = song_load(file, uri, error);