]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[master] address SunStudio build failure
authorYoshitaka Aharen <aharen@jprs.co.jp>
Wed, 14 Dec 2011 10:51:06 +0000 (19:51 +0900)
committerYoshitaka Aharen <aharen@jprs.co.jp>
Wed, 14 Dec 2011 10:51:06 +0000 (19:51 +0900)
src/lib/statistics/counter_dict.cc

index 08302be813626e7dc8cf403d257a82d3aefaa463..da6aacebe4529cc58662ab8495c489edfac5289b 100644 (file)
@@ -75,9 +75,11 @@ CounterDictionaryImpl::deleteElement(const std::string& name) {
 
 Counter&
 CounterDictionaryImpl::getElement(const std::string& name) {
-    try {
-        return (*(dictionary_.at(name)));
-    } catch (const std::out_of_range&) {
+    DictionaryMap::const_iterator i = dictionary_.find(name);
+    if (i != dictionary_.end()) {
+        // the key was found. return the element.
+        return (*(i->second));
+    } else {
         // If an element with specified name does not exist, throw
         // isc::OutOfRange.
         isc_throw(isc::OutOfRange, "Element " << name << " does not exist");