Skip to content

Commit cf8604e

Browse files
committed
Don't use feature 'init-statements in if/switch'
1 parent b8f53c6 commit cf8604e

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

pathfinder/common/logger.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ class Logger {
6262
}
6363

6464
static void verbose(const std::string &label, const std::string &module = PATHFINDER_DEFAULT_LOG_TAG) {
65-
if (const auto level = get_effective_level(module); level <= Level::Verbose) {
65+
const auto level = get_effective_level(module);
66+
if (level <= Level::Verbose) {
6667
auto tag = module.c_str();
6768
#ifdef __ANDROID__
6869
__android_log_write(ANDROID_LOG_VERBOSE, tag, label.c_str());
@@ -73,7 +74,8 @@ class Logger {
7374
}
7475

7576
static void debug(const std::string &label, const std::string &module = PATHFINDER_DEFAULT_LOG_TAG) {
76-
if (const auto level = get_effective_level(module); level <= Level::Debug) {
77+
const auto level = get_effective_level(module);
78+
if (level <= Level::Debug) {
7779
auto tag = module.c_str();
7880
#ifdef __ANDROID__
7981
__android_log_write(ANDROID_LOG_DEBUG, tag, label.c_str());
@@ -84,7 +86,8 @@ class Logger {
8486
}
8587

8688
static void info(const std::string &label, const std::string &module = PATHFINDER_DEFAULT_LOG_TAG) {
87-
if (const auto level = get_effective_level(module); level <= Level::Info) {
89+
const auto level = get_effective_level(module);
90+
if (level <= Level::Info) {
8891
auto tag = module.c_str();
8992
#ifdef __ANDROID__
9093
__android_log_write(ANDROID_LOG_INFO, tag, label.c_str());
@@ -95,7 +98,8 @@ class Logger {
9598
}
9699

97100
static void warn(const std::string &label, const std::string &module = PATHFINDER_DEFAULT_LOG_TAG) {
98-
if (const auto level = get_effective_level(module); level <= Level::Warn) {
101+
const auto level = get_effective_level(module);
102+
if (level <= Level::Warn) {
99103
auto tag = module.c_str();
100104
#ifdef __ANDROID__
101105
__android_log_write(ANDROID_LOG_WARN, tag, label.c_str());
@@ -106,7 +110,8 @@ class Logger {
106110
}
107111

108112
static void error(const std::string &label, const std::string &module = PATHFINDER_DEFAULT_LOG_TAG) {
109-
if (const auto level = get_effective_level(module); level <= Level::Error) {
113+
const auto level = get_effective_level(module);
114+
if (level <= Level::Error) {
110115
auto tag = module.c_str();
111116
#ifdef __ANDROID__
112117
__android_log_write(ANDROID_LOG_ERROR, tag, label.c_str());

0 commit comments

Comments
 (0)