summaryrefslogtreecommitdiff
path: root/src/tag
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-19 03:11:01 +0100
committerMax Kellermann <max@duempel.org>2014-01-19 03:11:01 +0100
commitbde27ccec3468efb3bc669b980e8850cb5150e15 (patch)
treeb2f8a43c6be2101c3e43fbb310ee16ad0469b52c /src/tag
parentd2cf74027c2c252181ab16c1348281c252665353 (diff)
Tag: pack attributes tighter
This saves another 3% memory.
Diffstat (limited to 'src/tag')
-rw-r--r--src/tag/Tag.cxx4
-rw-r--r--src/tag/Tag.hxx10
2 files changed, 7 insertions, 7 deletions
diff --git a/src/tag/Tag.cxx b/src/tag/Tag.cxx
index 34bfc0495..448f3b26a 100644
--- a/src/tag/Tag.cxx
+++ b/src/tag/Tag.cxx
@@ -76,8 +76,8 @@ Tag::Clear()
Tag::Tag(const Tag &other)
: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) {
items = new TagItem *[num_items];
diff --git a/src/tag/Tag.hxx b/src/tag/Tag.hxx
index bd3381494..5d3aaad0c 100644
--- a/src/tag/Tag.hxx
+++ b/src/tag/Tag.hxx
@@ -47,23 +47,23 @@ struct Tag {
*/
bool has_playlist;
+ /** the total number of tag items in the #items array */
+ unsigned short num_items;
+
/** an array of tag items */
TagItem **items;
- /** the total number of tag items in the #items array */
- unsigned num_items;
-
/**
* Create an empty tag.
*/
Tag():time(-1), has_playlist(false),
- items(nullptr), num_items(0) {}
+ num_items(0), items(nullptr) {}
Tag(const Tag &other);
Tag(Tag &&other)
: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.num_items = 0;
}