Browse Source

Small build fixes.

Adam Ierymenko 5 years ago
parent
commit
b3314cd34f
3 changed files with 5 additions and 5 deletions
  1. 2 2
      node/Dictionary.cpp
  2. 2 2
      node/Dictionary.hpp
  3. 1 1
      node/Map.hpp

+ 2 - 2
node/Dictionary.cpp

@@ -31,7 +31,7 @@ std::vector<uint8_t> &Dictionary::operator[](const char *k)
 const std::vector<uint8_t> &Dictionary::operator[](const char *k) const
 {
 	static const std::vector<uint8_t> emptyEntry;
-	std::map< uint64_t,std::vector<uint8_t> >::const_iterator e(_t.find(_toKey(k)));
+	Map< uint64_t,std::vector<uint8_t> >::const_iterator e(_t.find(_toKey(k)));
 	return (e == _t.end()) ? emptyEntry : e->second;
 }
 
@@ -156,7 +156,7 @@ void Dictionary::encode(std::vector<uint8_t> &out) const
 
 	out.clear();
 
-	for(std::map< uint64_t,std::vector<uint8_t> >::const_iterator ti(_t.begin());ti!=_t.end();++ti) {
+	for(Map< uint64_t,std::vector<uint8_t> >::const_iterator ti(_t.begin());ti!=_t.end();++ti) {
 		str[0] = ti->first;
 		const char *k = (const char *)str;
 		for(;;) {

+ 2 - 2
node/Dictionary.hpp

@@ -18,10 +18,10 @@
 #include "Utils.hpp"
 #include "Address.hpp"
 #include "Buf.hpp"
+#include "Map.hpp"
 
 #include <cstdint>
 #include <vector>
-#include <map>
 
 namespace ZeroTier {
 
@@ -180,7 +180,7 @@ private:
 		return key;
 	}
 
-	std::map< uint64_t,std::vector<uint8_t> > _t;
+	Map< uint64_t,std::vector<uint8_t> > _t;
 };
 
 } // namespace ZeroTier

+ 1 - 1
node/Map.hpp

@@ -84,7 +84,7 @@ public:
 
 	ZT_INLINE void set(const K &key,const V &value)
 	{
-		this->emplace(key,value);
+		(*this)[key] = value;
 	}
 };
 #endif