Skip to content

Commit 81a2d51

Browse files
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.
1 parent 59dd995 commit 81a2d51

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Diff for: api/String.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,7 @@ unsigned char String::concat(const char *cstr)
297297

298298
unsigned char String::concat(char c)
299299
{
300-
char buf[2];
301-
buf[0] = c;
302-
buf[1] = 0;
303-
return concat(buf, 1);
300+
return concat(&c, 1);
304301
}
305302

306303
unsigned char String::concat(unsigned char num)

0 commit comments

Comments
 (0)