diff options
| author | Grant Limberg <glimberg@gmail.com> | 2015-07-16 18:09:57 -0700 |
|---|---|---|
| committer | Grant Limberg <glimberg@gmail.com> | 2015-07-16 18:09:57 -0700 |
| commit | 1e8ead441c90b731573d7949152643e0082bdb2e (patch) | |
| tree | 80f15238fc0b3543f880bcd03564fe6e2ee95731 /node/Dictionary.hpp | |
| parent | e45475c5b5bcee4fb88e797a50eb38b6ad3d6923 (diff) | |
| parent | 0db7c94c9004ac488b6163905d80f7515141d9c6 (diff) | |
| download | infinitytier-1e8ead441c90b731573d7949152643e0082bdb2e.tar.gz infinitytier-1e8ead441c90b731573d7949152643e0082bdb2e.zip | |
Merge branch 'adamierymenko-dev' into android-jni
Diffstat (limited to 'node/Dictionary.hpp')
| -rw-r--r-- | node/Dictionary.hpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/node/Dictionary.hpp b/node/Dictionary.hpp index 8628bc44..1e643788 100644 --- a/node/Dictionary.hpp +++ b/node/Dictionary.hpp @@ -33,7 +33,7 @@ #include <string> #include <map> #include <stdexcept> - + #include "Constants.hpp" #include "Utils.hpp" @@ -305,6 +305,21 @@ public: */ bool verify(const Identity &id) const; + inline bool operator==(const Dictionary &d) const + { + // std::map::operator== is broken on uclibc++ + if (size() != d.size()) + return false; + const_iterator a(begin()); + const_iterator b(d.begin()); + while (a != end()) { + if (*(a++) != *(b++)) + return false; + } + return true; + } + inline bool operator!=(const Dictionary &d) const { return (!(*this == d)); } + private: void _mkSigBuf(std::string &buf) const; static void _appendEsc(const char *data,unsigned int len,std::string &to); |
