diff options
author | Herman Semenov <GermanAizek@yandex.ru> | 2022-09-06 13:21:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-06 11:21:09 +0100 |
commit | 038da00e799b4bf3af824075a260083c56392964 (patch) | |
tree | 8c0e3218455073684c2521cec41b7df06fff8598 /src/main.cpp | |
parent | ff6dcfea82974df6db5a557e31aaddb6bdb7a71f (diff) | |
download | minetest-038da00e799b4bf3af824075a260083c56392964.tar.xz |
Code optimizations / refactor (#12704)
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
Co-authored-by: sfan5 <sfan5@live.de>
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp index d927b141b..fa4fd604f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -484,7 +484,7 @@ static bool setup_log_params(const Settings &cmd_args) color_mode = color_mode_env; #endif } - if (color_mode != "") { + if (!color_mode.empty()) { if (color_mode == "auto") { Logger::color_mode = LOG_COLOR_AUTO; } else if (color_mode == "always") { @@ -586,7 +586,7 @@ static void startup_message() static bool read_config_file(const Settings &cmd_args) { // Path of configuration file in use - sanity_check(g_settings_path == ""); // Sanity check + sanity_check(g_settings_path.empty()); // Sanity check if (cmd_args.exists("config")) { bool r = g_settings->readConfigFile(cmd_args.get("config").c_str()); @@ -793,7 +793,7 @@ static bool auto_select_world(GameParams *game_params) << world_path << "]" << std::endl; } - assert(world_path != ""); // Post-condition + assert(!world_path.empty()); // Post-condition game_params->world_path = world_path; return true; } @@ -849,7 +849,7 @@ static bool determine_subgame(GameParams *game_params) { SubgameSpec gamespec; - assert(game_params->world_path != ""); // Pre-condition + assert(!game_params->world_path.empty()); // Pre-condition // If world doesn't exist if (!game_params->world_path.empty() |