From e64198666b8a3c51dd4e46df07f51555f21ccac7 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Sun, 29 Nov 2015 11:40:00 +0200 Subject: [PATCH] Remove [] accessors --- pdns/iputils.hh | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/pdns/iputils.hh b/pdns/iputils.hh index 5cd6f87808..812119d131 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 { -- 2.47.2