Skip to content

Commit 1942ef5

Browse files
matthijskooijmanaentinger
authored andcommitted
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 14c0887 commit 1942ef5

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

284284
unsigned char String::concat(char c)
285285
{
286-
char buf[2];
287-
buf[0] = c;
288-
buf[1] = 0;
289-
return concat(buf, 1);
286+
return concat(&c, 1);
290287
}
291288

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

0 commit comments

Comments
 (0)