aboutsummaryrefslogtreecommitdiffstats
path: root/src/Song.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-21 23:19:15 +0200
committerMax Kellermann <max@duempel.org>2013-10-21 23:19:15 +0200
commit20cba9e89f80d788a1cc65473865f52de94ea451 (patch)
tree7e9d96754b4f59ea2235c1455e18ba83cd31411a /src/Song.cxx
parentf6d67ac260ad12a6465378d93d03d98fea857ec8 (diff)
downloadmpd-20cba9e89f80d788a1cc65473865f52de94ea451.tar.gz
mpd-20cba9e89f80d788a1cc65473865f52de94ea451.tar.xz
mpd-20cba9e89f80d788a1cc65473865f52de94ea451.zip
Song: pass reference to song_equals()
Diffstat (limited to 'src/Song.cxx')
-rw-r--r--src/Song.cxx19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/Song.cxx b/src/Song.cxx
index c63dc8753..7a11a0611 100644
--- a/src/Song.cxx
+++ b/src/Song.cxx
@@ -127,23 +127,20 @@ directory_is_same(const Directory *a, const Directory *b)
}
bool
-song_equals(const Song *a, const Song *b)
+SongEquals(const Song &a, const Song &b)
{
- assert(a != nullptr);
- assert(b != nullptr);
-
- if (a->parent != nullptr && b->parent != nullptr &&
- !directory_equals(*a->parent, *b->parent) &&
- (a->parent == &detached_root || b->parent == &detached_root)) {
+ if (a.parent != nullptr && b.parent != nullptr &&
+ !directory_equals(*a.parent, *b.parent) &&
+ (a.parent == &detached_root || b.parent == &detached_root)) {
/* must compare the full URI if one of the objects is
"detached" */
- const auto au = a->GetURI();
- const auto bu = b->GetURI();
+ const auto au = a.GetURI();
+ const auto bu = b.GetURI();
return au == bu;
}
- return directory_is_same(a->parent, b->parent) &&
- strcmp(a->uri, b->uri) == 0;
+ return directory_is_same(a.parent, b.parent) &&
+ strcmp(a.uri, b.uri) == 0;
}
std::string