Skip to content

Commit f2371d9

Browse files
Fix tab/space issues
1 parent a5a18e1 commit f2371d9

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

cores/esp8266/WString.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,7 @@ void String::move(String &rhs) {
226226
if(capacity() >= rhs.len()) {
227227
strcpy(wbuffer(), rhs.buffer());
228228
setLen(rhs.len());
229-
if (!rhs.sso()) free(rhs.ptr.buf);
230-
rhs.setSSO(false);
231-
rhs.setCapacity(0);
232-
rhs.setLen(0);
233-
rhs.ptr.buf = nullptr;
229+
rhs.invalidate();
234230
return;
235231
} else {
236232
if (!sso()) {
@@ -478,7 +474,8 @@ StringSumHelper & operator +(const StringSumHelper &lhs, double num) {
478474
StringSumHelper & operator + (const StringSumHelper &lhs, const __FlashStringHelper *rhs)
479475
{
480476
StringSumHelper &a = const_cast<StringSumHelper&>(lhs);
481-
if (!a.concat(rhs)) a.invalidate();
477+
if (!a.concat(rhs))
478+
a.invalidate();
482479
return a;
483480
}
484481

cores/esp8266/WString.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@ class String {
249249
enum { SSOSIZE = 12 }; // Characters to allocate space for SSO, must be 12 or more
250250
enum { CAPACITY_MAX = 65535 }; // If size of capacity changed, be sure to update this enum
251251
union {
252-
struct {
253-
uint16_t cap;
254-
uint16_t len;
255-
char * buf;
256-
} ptr;
257-
char sso_buf[SSOSIZE];
252+
struct {
253+
uint16_t cap;
254+
uint16_t len;
255+
char * buf;
256+
} ptr;
257+
char sso_buf[SSOSIZE];
258258
};
259259
// Accessor functions
260260
inline bool sso() const { return sso_buf[SSOSIZE - 1] == 0; }

0 commit comments

Comments
 (0)