summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-08-26 23:19:45 -0700
committerSamuel Just <sam.just@inktank.com>2013-08-26 23:19:47 -0700
commiteeb1f863b29d849fd81ee2a8c6ffc821db932ce7 (patch)
treeee775e4d93d437ff921f563cdf3cb8d61f173726
parent39adc0195e6016ce36828885515be1bffbc10ae1 (diff)
downloadceph-wip-dumpling-log-assert.tar.gz
PGLog: move the log size check after the early returnwip-dumpling-log-assert
Amazingly, some versions of g++ (like the one on my ubuntu 12.04 machine) appear to have a list::size() which is linear in the size of the list. That assert, therefore, is quite expensive! Signed-off-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/osd/PGLog.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h
index 552f9b0cee9..712c1e1c917 100644
--- a/src/osd/PGLog.h
+++ b/src/osd/PGLog.h
@@ -205,11 +205,11 @@ protected:
log_keys_debug->erase(i++));
}
void check() {
- assert(log.log.size() == log_keys_debug.size());
if (cct &&
!(cct->_conf->osd_debug_pg_log_writeout)) {
return;
}
+ assert(log.log.size() == log_keys_debug.size());
for (list<pg_log_entry_t>::iterator i = log.log.begin();
i != log.log.end();
++i) {