From: Aki Tuomi Date: Sun, 29 Nov 2015 09:40:00 +0000 (+0200) Subject: Remove [] accessors X-Git-Tag: dnsdist-1.0.0-alpha1~168^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e64198666b8a3c51dd4e46df07f51555f21ccac7;p=pdns Remove [] accessors --- diff --git a/pdns/iputils.hh b/pdns/iputils.hh index 5cd6f8780..812119d13 100644 --- a/pdns/iputils.hh +++ b/pdns/iputils.hh @@ -472,18 +472,6 @@ public: return *this; } - //second; - } - - //::const_iterator begin() const { return _nodes.begin(); } const typename std::vector::const_iterator end() const { return _nodes.end(); } @@ -554,10 +542,8 @@ public: insert(mask).second = value; } - const node_type& at(const key_type& value) const { - const node_type* node = lookup(value); - if (node == nullptr) throw std::range_error(value.toString() + string(" not found")); - return *node; + void insert_or_assign(const string& mask, const value_type& value) { + insert(key_type(mask)).second = value; } const node_type* lookup(const key_type& value) const {