Commit 6239dd96 authored by Max Kellermann's avatar Max Kellermann

Tag: remove unused methods

parent 57a4700f
......@@ -106,42 +106,6 @@ Tag::Clear()
num_items = 0;
}
void
Tag::DeleteItem(unsigned idx)
{
assert(idx < num_items);
--num_items;
tag_pool_lock.lock();
tag_pool_put_item(items[idx]);
tag_pool_lock.unlock();
if (num_items - idx > 0) {
memmove(items + idx, items + idx + 1,
(num_items - idx) * sizeof(items[0]));
}
if (num_items > 0) {
items = (TagItem **)
g_realloc(items, items_size(*this));
} else {
g_free(items);
items = nullptr;
}
}
void
Tag::ClearItemsByType(tag_type type)
{
for (unsigned i = 0; i < num_items; i++) {
if (items[i]->type == type) {
DeleteItem(i);
/* decrement since when just deleted this node */
i--;
}
}
}
Tag::~Tag()
{
tag_pool_lock.lock();
......@@ -252,26 +216,6 @@ Tag::HasType(tag_type type) const
return GetValue(type) != nullptr;
}
bool
Tag::Equals(const Tag &other) const
{
if (time != other.time)
return false;
if (num_items != other.num_items)
return false;
for (unsigned i = 0; i < num_items; i++) {
if (items[i]->type != other.items[i]->type)
return false;
if (strcmp(items[i]->value, other.items[i]->value)) {
return false;
}
}
return true;
}
/**
* Replace invalid sequences with the question mark.
*/
......
......@@ -117,13 +117,6 @@ struct Tag {
*/
void Clear();
void DeleteItem(unsigned i);
/**
* Clear all tag items with the specified type.
*/
void ClearItemsByType(tag_type type);
/**
* Gives an optional hint to the tag library that we will now
* add several tag items; this is used by the library to
......@@ -187,13 +180,6 @@ struct Tag {
*/
bool HasType(tag_type type) const;
/**
* Compares two tags, including the duration and all tag items. The
* order of the tag items matters.
*/
gcc_pure
bool Equals(const Tag &other) const;
private:
void AddItemInternal(tag_type type, const char *value, size_t len);
};
......
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