From 758b0bd124e8042162396a943aa91dfc6c0adc39 Mon Sep 17 00:00:00 2001 From: fabianoms Date: Sat, 28 Apr 2018 17:02:08 -0300 Subject: [PATCH] Minimizing code redundancy (#4695) String's destructor does the same as the 'invalidate' method. --- cores/esp8266/WString.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cores/esp8266/WString.cpp b/cores/esp8266/WString.cpp index 6f2134e86f..c81b594d6c 100644 --- a/cores/esp8266/WString.cpp +++ b/cores/esp8266/WString.cpp @@ -113,10 +113,7 @@ String::String(double value, unsigned char decimalPlaces) { } String::~String() { - if(buffer) { - free(buffer); - } - init(); + invalidate(); } // /*********************************************/