Skip to content

Fix move constructor and operator= in String. #6261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove redundant null checks.
  • Loading branch information
leg0 committed Jan 19, 2018
commit a30f73b1d96a8fadfcbb2b0b99b37b32f0fe4789
5 changes: 2 additions & 3 deletions hardware/arduino/avr/cores/arduino/WString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ inline void String::init(void)

void String::invalidate(void)
{
if (buffer) free(buffer);
free(buffer);
buffer = NULL;
capacity = len = 0;
}
Expand Down Expand Up @@ -193,8 +193,7 @@ void String::move(String &rhs)
{
if (this != &rhs)
{
if (buffer != NULL)
free(buffer);
free(buffer);

buffer = rhs.buffer;
len = rhs.len;
Expand Down