Browse Source

[2225_statistics] remove 'else' statement

In stead of being removed, it just returns if DataNotFoundError is raised.

Due to the review comment.
Naoki Kambe 12 years ago
parent
commit
65bbcd0970
1 changed files with 12 additions and 13 deletions
  1. 12 13
      src/lib/python/isc/statistics/counter.py

+ 12 - 13
src/lib/python/isc/statistics/counter.py

@@ -337,19 +337,18 @@ class Counters():
                                               identifier)
             except isc.cc.data.DataNotFoundError:
                 # do not set the end time if the timer isn't started
-                pass
-            else:
-                # set the end time
-                _stop_timer(
-                    start_time,
-                    self._statistics._data,
-                    self._statistics._spec,
-                    identifier)
-                # delete the started timer
-                del isc.cc.data.find(
-                    self._start_time,
-                    _concat(*identifier.split('/')[0:-1]))\
-                    [identifier.split('/')[-1]]
+                return
+            # set the end time
+            _stop_timer(
+                start_time,
+                self._statistics._data,
+                self._statistics._spec,
+                identifier)
+            # delete the started timer
+            del isc.cc.data.find(
+                self._start_time,
+                _concat(*identifier.split('/')[0:-1]))\
+                [identifier.split('/')[-1]]
 
     def dump_statistics(self):
         """Calculates an entire server counts, and returns statistics