]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/LogEntry: pass by value for contains()
authorSage Weil <sage@inktank.com>
Sat, 25 Aug 2012 02:52:20 +0000 (19:52 -0700)
committerSage Weil <sage@inktank.com>
Fri, 31 Aug 2012 20:11:35 +0000 (13:11 -0700)
CID 717031: Big parameter passed by value (PASS_BY_VALUE)
At (1): Passing parameter k of type LogEntryKey (size 168 bytes) by value.

Signed-off-by: Sage Weil <sage@inktank.com>
src/common/LogEntry.h

index 67ac9e638340c50fcdd164315aee4940d64d003f..160d0d00294157859ce0518bd1a31e05cd8673f1 100644 (file)
@@ -84,11 +84,12 @@ struct LogSummary {
     while (tail.size() > 50)
       tail.pop_front();
   }
-  bool contains(LogEntryKey k) const {
+  bool contains(const LogEntryKey& k) const {
     for (list<LogEntry>::const_iterator p = tail.begin();
         p != tail.end();
         p++)
-      if (p->key() == k) return true;
+      if (p->key() == k)
+       return true;
     return false;
   }