From: Thomas Debesse Date: Tue, 18 Jul 2017 09:26:44 +0000 (+0200) Subject: deduplicate empty string affectation X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cea81dbee7648b190b9688b9ae3447974439e6a7;p=xonotic%2Fnetradiant.git deduplicate empty string affectation These the first line is useless, since being overwritten: g_pStrWork = ""; g_pStrWork = new char[1]; g_pStrWork[0] = '\0'; Also, that first line uselessly raises this warning: ISO C++ forbids converting a string constant to ‘char*’ --- diff --git a/libs/str.h b/libs/str.h index 9090bf2d..fcc328b1 100644 --- a/libs/str.h +++ b/libs/str.h @@ -254,7 +254,6 @@ const char* Left( std::size_t n ){ } else { - g_pStrWork = ""; g_pStrWork = new char[1]; g_pStrWork[0] = '\0'; } @@ -290,7 +289,6 @@ const char* Mid( std::size_t first, std::size_t n ) const { } else { - g_pStrWork = ""; g_pStrWork = new char[1]; g_pStrWork[0] = '\0'; }