diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-07-13 11:39:55 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-07-13 11:39:55 -0700 |
commit | 88949a750fd6124aff2d38c1273ce3f4137b8c98 (patch) | |
tree | f0c84b622a5f20abd901b6bbbffc2ee2c324211d /node | |
parent | 547b1c6157099745263b58f5fd83f181043d7340 (diff) | |
download | infinitytier-88949a750fd6124aff2d38c1273ce3f4137b8c98.tar.gz infinitytier-88949a750fd6124aff2d38c1273ce3f4137b8c98.zip |
Workaround for uclibc missing map::operator==()
Diffstat (limited to 'node')
-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); |