From eeb1f863b29d849fd81ee2a8c6ffc821db932ce7 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 26 Aug 2013 23:19:45 -0700 Subject: PGLog: move the log size check after the early return 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 --- src/osd/PGLog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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::iterator i = log.log.begin(); i != log.log.end(); ++i) { -- cgit v1.2.1