diff options
author | Max Kellermann <max@musicpd.org> | 2017-11-10 19:24:33 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-11-10 19:24:33 +0100 |
commit | 49784513b13ae8c5a5811fab8439463964a9e151 (patch) | |
tree | 7c2bd603ff23a4cab138b38a15e2892588621dfd /src/tag | |
parent | 523051132d77cb5da01847592c4c1e1faae93c6a (diff) |
util/{Const,Writable}Buffer, ...: rename IsEmpty() to empty(), imitating STL
Diffstat (limited to 'src/tag')
-rw-r--r-- | src/tag/Builder.cxx | 4 | ||||
-rw-r--r-- | src/tag/Builder.hxx | 4 | ||||
-rw-r--r-- | src/tag/Id3Scan.cxx | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/tag/Builder.cxx b/src/tag/Builder.cxx index 463c9871f..d950c036b 100644 --- a/src/tag/Builder.cxx +++ b/src/tag/Builder.cxx @@ -191,7 +191,7 @@ TagBuilder::Complement(const Tag &other) inline void TagBuilder::AddItemInternal(TagType type, StringView value) { - assert(!value.IsEmpty()); + assert(!value.empty()); auto f = FixTagString(value); if (!f.IsNull()) @@ -209,7 +209,7 @@ TagBuilder::AddItemInternal(TagType type, StringView value) void TagBuilder::AddItem(TagType type, StringView value) { - if (value.IsEmpty() || !IsTagEnabled(type)) + if (value.empty() || !IsTagEnabled(type)) return; AddItemInternal(type, value); diff --git a/src/tag/Builder.hxx b/src/tag/Builder.hxx index 396b626e2..2b0d3ef7e 100644 --- a/src/tag/Builder.hxx +++ b/src/tag/Builder.hxx @@ -74,7 +74,7 @@ public: * Returns true if the tag contains no items. This ignores * the "duration" attribute. */ - bool IsEmpty() const { + bool empty() const { return items.empty(); } @@ -83,7 +83,7 @@ public: */ gcc_pure bool IsDefined() const noexcept { - return !duration.IsNegative() || has_playlist || !IsEmpty(); + return !duration.IsNegative() || has_playlist || !empty(); } void Clear(); diff --git a/src/tag/Id3Scan.cxx b/src/tag/Id3Scan.cxx index d36762845..db428137d 100644 --- a/src/tag/Id3Scan.cxx +++ b/src/tag/Id3Scan.cxx @@ -334,7 +334,7 @@ tag_id3_import(struct id3_tag *tag) { TagBuilder tag_builder; scan_id3_tag(tag, add_tag_handler, &tag_builder); - return tag_builder.IsEmpty() + return tag_builder.empty() ? nullptr : tag_builder.CommitNew(); } |