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

api/String.cpp

Lines changed: 1 addition & 4 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy