deduplicate empty string affectation 57/head
authorThomas Debesse <dev@illwieckz.net>
Tue, 18 Jul 2017 09:26:44 +0000 (11:26 +0200)
committerThomas Debesse <dev@illwieckz.net>
Tue, 1 Aug 2017 14:31:20 +0000 (16:31 +0200)
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

index 9090bf2..fcc328b 100644 (file)
@@ -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';
        }