diff options
Diffstat (limited to '')
-rw-r--r-- | src/SongSort.cxx | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/SongSort.cxx b/src/SongSort.cxx index 4d422657a..dcea033b6 100644 --- a/src/SongSort.cxx +++ b/src/SongSort.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2013 The Music Player Daemon Project + * Copyright (C) 2003-2014 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -20,7 +20,6 @@ #include "config.h" #include "SongSort.hxx" #include "Song.hxx" -#include "util/list.h" #include "tag/Tag.hxx" extern "C" { @@ -29,17 +28,8 @@ extern "C" { #include <glib.h> -#include <assert.h> #include <stdlib.h> -static const char * -tag_get_value_checked(const Tag *tag, TagType type) -{ - return tag != nullptr - ? tag->GetValue(type) - : nullptr; -} - static int compare_utf8_string(const char *a, const char *b) { @@ -57,11 +47,11 @@ compare_utf8_string(const char *a, const char *b) * nullptr. */ static int -compare_string_tag_item(const Tag *a, const Tag *b, +compare_string_tag_item(const Tag &a, const Tag &b, TagType type) { - return compare_utf8_string(tag_get_value_checked(a, type), - tag_get_value_checked(b, type)); + return compare_utf8_string(a.GetValue(type), + b.GetValue(type)); } /** @@ -84,10 +74,10 @@ compare_number_string(const char *a, const char *b) } static int -compare_tag_item(const Tag *a, const Tag *b, TagType type) +compare_tag_item(const Tag &a, const Tag &b, TagType type) { - return compare_number_string(tag_get_value_checked(a, type), - tag_get_value_checked(b, type)); + return compare_number_string(a.GetValue(type), + b.GetValue(type)); } /* Only used for sorting/searchin a songvec, not general purpose compares */ |