Commit bde27cce authored by Max Kellermann's avatar Max Kellermann

Tag: pack attributes tighter

This saves another 3% memory.
parent d2cf7402
...@@ -76,8 +76,8 @@ Tag::Clear() ...@@ -76,8 +76,8 @@ Tag::Clear()
Tag::Tag(const Tag &other) Tag::Tag(const Tag &other)
:time(other.time), has_playlist(other.has_playlist), :time(other.time), has_playlist(other.has_playlist),
items(nullptr), num_items(other.num_items),
num_items(other.num_items) items(nullptr)
{ {
if (num_items > 0) { if (num_items > 0) {
items = new TagItem *[num_items]; items = new TagItem *[num_items];
......
...@@ -47,23 +47,23 @@ struct Tag { ...@@ -47,23 +47,23 @@ struct Tag {
*/ */
bool has_playlist; bool has_playlist;
/** the total number of tag items in the #items array */
unsigned short num_items;
/** an array of tag items */ /** an array of tag items */
TagItem **items; TagItem **items;
/** the total number of tag items in the #items array */
unsigned num_items;
/** /**
* Create an empty tag. * Create an empty tag.
*/ */
Tag():time(-1), has_playlist(false), Tag():time(-1), has_playlist(false),
items(nullptr), num_items(0) {} num_items(0), items(nullptr) {}
Tag(const Tag &other); Tag(const Tag &other);
Tag(Tag &&other) Tag(Tag &&other)
:time(other.time), has_playlist(other.has_playlist), :time(other.time), has_playlist(other.has_playlist),
items(other.items), num_items(other.num_items) { num_items(other.num_items), items(other.items) {
other.items = nullptr; other.items = nullptr;
other.num_items = 0; other.num_items = 0;
} }
......
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