optimization and fixes

This commit is contained in:
2020-06-09 17:52:17 +03:00
parent d5cef947ee
commit 4ec87e0e2a
4 changed files with 18 additions and 11 deletions

View File

@@ -197,6 +197,7 @@ public:
const T at(const Key & key) const {return (*this)[key];}
PIMap<Key, T> & operator <<(const PIMap<Key, T> & other) {
if (&other == this) return *this;
if (other.isEmpty()) return *this;
if (other.size() == 1) {insert(other.pim_index[0].key, other.pim_content[0]); return *this;}
if (other.size() == 2) {insert(other.pim_index[0].key, other.pim_content[0]); insert(other.pim_index[1].key, other.pim_content[1]); return *this;}