Skip to content

Commit 82827d6

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 79b6489 commit 82827d6

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
@@ -281,10 +281,7 @@ unsigned char String::concat(const char *cstr)
281281

282282
unsigned char String::concat(char c)
283283
{
284-
char buf[2];
285-
buf[0] = c;
286-
buf[1] = 0;
287-
return concat(buf, 1);
284+
return concat(&c, 1);
288285
}
289286

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

0 commit comments

Comments
 (0)