diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-12-04 14:40:10 -0800 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-12-04 14:40:10 -0800 |
| commit | 16613ab5fb5a1f6cb1271ae67e68836a1898023d (patch) | |
| tree | 7645a268b922c5786985f1e4348279e2b68fa0be /node/Hashtable.hpp | |
| parent | c26bf45e28fcf74ce2f0adff5a67787794c30940 (diff) | |
| download | infinitytier-16613ab5fb5a1f6cb1271ae67e68836a1898023d.tar.gz infinitytier-16613ab5fb5a1f6cb1271ae67e68836a1898023d.zip | |
Clean up remote tracing code, add per-network remote trace settings, add remote trace level, and make local trace output readable again.
Diffstat (limited to 'node/Hashtable.hpp')
| -rw-r--r-- | node/Hashtable.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/node/Hashtable.hpp b/node/Hashtable.hpp index e5496592..5aa045b9 100644 --- a/node/Hashtable.hpp +++ b/node/Hashtable.hpp @@ -256,6 +256,24 @@ public: inline const V *get(const K &k) const { return const_cast<Hashtable *>(this)->get(k); } /** + * @param k Key + * @param v Value to fill with result + * @return True if value was found and set (if false, v is not modified) + */ + inline bool get(const K &k,V &v) const + { + _Bucket *b = _t[_hc(k) % _bc]; + while (b) { + if (b->k == k) { + v = b->v; + return true; + } + b = b->next; + } + return false; + } + + /** * @param k Key to check * @return True if key is present */ |
