From 885316c4c45f59f64ab1ed1afe5b5f598929644e Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 30 Jul 2018 01:02:56 +0200 Subject: Small optimization --- common/log.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/log.cpp b/common/log.cpp index d94536f..5156a23 100644 --- a/common/log.cpp +++ b/common/log.cpp @@ -363,6 +363,10 @@ static bool isFiltered(DebugLevel debugLevel, const QByteArray &fullDebugArea) bool Sink::Log::isFiltered(DebugLevel debugLevel, const char *debugArea, const char *debugComponent, const char *file) { + //Avoid assembleDebugArea if we can, because it's fairly expensive. + if (debugLevel < debugOutputLevel()) { + return true; + } return isFiltered(debugLevel, assembleDebugArea(debugArea, debugComponent, file).toLatin1()); } -- cgit v1.2.3