Skip to content
Prev Previous commit
Next Next commit
Simplify String::concat(char)
Now concat(const char*, unsigned int) no longer requires a
nul-terminated string, we can simplify the concat(char) method to just
pass the address of the single character instead of having to create
buffer with nul-termination.
  • Loading branch information
matthijskooijman committed Jan 25, 2021
commit 81a2d51b212c1ea8594065b34de1abd711cdcc42
5 changes: 1 addition & 4 deletions api/String.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,7 @@ unsigned char String::concat(const char *cstr)

unsigned char String::concat(char c)
{
char buf[2];
buf[0] = c;
buf[1] = 0;
return concat(buf, 1);
return concat(&c, 1);
}

unsigned char String::concat(unsigned char num)
Expand Down