Commit 3965b490 authored by Max Kellermann's avatar Max Kellermann

db/Helpers: use reference instead of pointer

parent b999e164
......@@ -26,6 +26,7 @@
#include <functional>
#include <set>
#include <assert.h>
#include <string.h>
struct StringLess {
......@@ -40,12 +41,13 @@ typedef std::set<const char *, StringLess> StringSet;
static bool
CollectTags(StringSet &set, TagType tag_type, const LightSong &song)
{
const Tag *tag = song.tag;
assert(song.tag != nullptr);
const Tag &tag = *song.tag;
bool found = false;
for (unsigned i = 0; i < tag->num_items; ++i) {
if (tag->items[i]->type == tag_type) {
set.insert(tag->items[i]->value);
for (unsigned i = 0; i < tag.num_items; ++i) {
if (tag.items[i]->type == tag_type) {
set.insert(tag.items[i]->value);
found = true;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment