]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2726] Pass params by reference
authorMichal 'vorner' Vaner <vorner@vorner.cz>
Fri, 14 Jun 2013 08:19:23 +0000 (10:19 +0200)
committerMichal 'vorner' Vaner <vorner@vorner.cz>
Fri, 14 Jun 2013 08:19:23 +0000 (10:19 +0200)
This is mostly to silence cppcheck, than to save some CPU power (with
int it makes little sense) and it is less noisy than to put suppression
there.

src/lib/statistics/counter.h

index b0d31e946f1a1ad742fdf6db156b0ae33d6bea15..32d025e716f2eb3bdd78b3ec1e65c40bf8d10c78 100644 (file)
@@ -55,7 +55,7 @@ public:
     /// \param type %Counter item to increment
     ///
     /// \throw isc::OutOfRange \a type is invalid
-    void inc(const Counter::Type type) {
+    void inc(const Counter::Type& type) {
         if (type >= counters_.size()) {
             isc_throw(isc::OutOfRange, "Counter type is out of range");
         }
@@ -68,7 +68,7 @@ public:
     /// \param type %Counter item to get the value of
     ///
     /// \throw isc::OutOfRange \a type is invalid
-    const Counter::Value& get(const Counter::Type type) const {
+    const Counter::Value& get(const Counter::Type& type) const {
         if (type >= counters_.size()) {
             isc_throw(isc::OutOfRange, "Counter type is out of range");
         }