File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3651,8 +3651,13 @@ class HashMap {
36513651 ::std::vector<K> keySet () const { ::std::vector<K> r; for (auto & p:data) r.push_back (p.first ); return r; }
36523652 ::std::vector<V> values () const { ::std::vector<V> r; for (auto & p:data) r.push_back (p.second ); return r; }
36533653 V& operator [](const K& k) { return data[k]; }
3654+ V getOrDefault (const K& k, const V& def) const { auto it=data.find (k); return it!=data.end ()?it->second :def; }
3655+ void putAll (const HashMap<K,V>& m) { for (auto & p:m.data ) data[p.first ]=p.second ; }
3656+ void putIfAbsent (const K& k, const V& v){ if (!data.count (k)) data[k]=v; }
3657+ ::std::vector<::std::pair<K,V>> entrySet () const { ::std::vector<::std::pair<K,V>> r; for (auto & p:data) r.push_back (p); return r; }
36543658};
36553659
3660+
36563661// =============================================================================
36573662// TABLEROW -- single row accessor for Table iteration
36583663// =============================================================================
You can’t perform that action at this time.
0 commit comments