From cea81dbee7648b190b9688b9ae3447974439e6a7 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Tue, 18 Jul 2017 11:26:44 +0200 Subject: [PATCH] deduplicate empty string affectation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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*’ --- libs/str.h | 2 -- 1 file changed, 2 deletions(-) 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'; } -- 2.39.2