From 5c6cb9eca80a7bb18beb0fae42426b97a9f99fe0 Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Wed, 2 Sep 2015 21:31:36 +0200 Subject: More inlining. Closes #3 --- include/tag_array.h | 12 ++++++------ include/tag_compound.h | 14 +++++++------- include/tag_list.h | 12 ++++++------ include/tag_string.h | 10 +++++----- 4 files changed, 24 insertions(+), 24 deletions(-) (limited to 'include') diff --git a/include/tag_array.h b/include/tag_array.h index 342d3a4ceb..c59249b571 100644 --- a/include/tag_array.h +++ b/include/tag_array.h @@ -97,12 +97,12 @@ public: void clear() { data.clear(); } //Iterators - iterator begin(); - iterator end(); - const_iterator begin() const; - const_iterator end() const; - const_iterator cbegin() const; - const_iterator cend() const; + iterator begin() { return data.begin(); } + iterator end() { return data.end(); } + const_iterator begin() const { return data.begin(); } + const_iterator end() const { return data.end(); } + const_iterator cbegin() const { return data.cbegin(); } + const_iterator cend() const { return data.cend(); } void read_payload(io::stream_reader& reader) override; /** diff --git a/include/tag_compound.h b/include/tag_compound.h index 2948059ce9..b1c4c996dc 100644 --- a/include/tag_compound.h +++ b/include/tag_compound.h @@ -63,7 +63,7 @@ public: * Returns a value to the tag with the specified key. If it does not exist, * creates a new uninitialized entry under the key. */ - value& operator[](const std::string& key); + value& operator[](const std::string& key) { return tags[key]; } /** * @brief Inserts or assigns a tag @@ -112,12 +112,12 @@ public: void clear() { tags.clear(); } //Iterators - iterator begin(); - iterator end(); - const_iterator begin() const; - const_iterator end() const; - const_iterator cbegin() const; - const_iterator cend() const; + iterator begin() { return tags.begin(); } + iterator end() { return tags.end(); } + const_iterator begin() const { return tags.begin(); } + const_iterator end() const { return tags.end(); } + const_iterator cbegin() const { return tags.cbegin(); } + const_iterator cend() const { return tags.cend(); } void read_payload(io::stream_reader& reader) override; void write_payload(io::stream_writer& writer) const override; diff --git a/include/tag_list.h b/include/tag_list.h index 05150323b9..c27da8697d 100644 --- a/include/tag_list.h +++ b/include/tag_list.h @@ -151,12 +151,12 @@ public: void reset(tag_type type = tag_type::Null); //Iterators - iterator begin(); - iterator end(); - const_iterator begin() const; - const_iterator end() const; - const_iterator cbegin() const; - const_iterator cend() const; + iterator begin() { return tags.begin(); } + iterator end() { return tags.end(); } + const_iterator begin() const { return tags.begin(); } + const_iterator end() const { return tags.end(); } + const_iterator cbegin() const { return tags.cbegin(); } + const_iterator cend() const { return tags.cend(); } /** * @inheritdoc diff --git a/include/tag_string.h b/include/tag_string.h index 48e7adf497..dee47f5f97 100644 --- a/include/tag_string.h +++ b/include/tag_string.h @@ -45,11 +45,11 @@ public: const std::string& get() const { return value; } //Setters - tag_string& operator=(const std::string& str); - tag_string& operator=(std::string&& str); - tag_string& operator=(const char* str); - void set(const std::string& str); - void set(std::string&& str); + tag_string& operator=(const std::string& str) { value = str; return *this; } + tag_string& operator=(std::string&& str) { value = std::move(str); return *this; } + tag_string& operator=(const char* str) { value = str; return *this; } + void set(const std::string& str) { value = str; } + void set(std::string&& str) { value = std::move(str); } void read_payload(io::stream_reader& reader) override; /** -- cgit 0.0.5-2-1-g0f52