From de150ef9b3c4c050c15154d9ac34ba323dbed477 Mon Sep 17 00:00:00 2001 From: likeawindrammer <31085911+likeawindrammer@users.noreply.github.com> Date: Fri, 28 Aug 2020 07:09:57 -0600 Subject: [PATCH] Simplify advertise_server assignation Since it's a bool we can just assign the result of the comparation --- src/config_manager.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/config_manager.cpp b/src/config_manager.cpp index 85f075e..555c3db 100644 --- a/src/config_manager.cpp +++ b/src/config_manager.cpp @@ -219,10 +219,9 @@ bool ConfigManager::loadServerSettings(server_settings* settings) } else { config->beginGroup("Options"); - if (config->value("advertise", "true").toString() != "true") - settings->advertise_server = false; - else - settings->advertise_server = true; + // Will be true of false depending on the key + settings->advertise_server = + (config->value("advertise", "true").toString() == "true"); if (config->value("webao_enable", "true").toString() != "true") settings->ws_port = -1;