projects
/
sdk
/
emulator
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d22b0bd
)
json-lexer: Drop 'buf'
author
Luiz Capitulino
<lcapitulino@redhat.com>
Mon, 17 May 2010 20:59:00 +0000
(17:59 -0300)
committer
Luiz Capitulino
<lcapitulino@redhat.com>
Fri, 11 Jun 2010 18:25:14 +0000
(15:25 -0300)
QString supports adding a single char, 'buf' is unneeded.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
json-lexer.c
patch
|
blob
|
history
diff --git
a/json-lexer.c
b/json-lexer.c
index 5cc7e6c9a911ba65dbb5d821f0578710f7c2af7d..1d9b81fef4c015cbac985c8e3b50693e05810cdf 100644
(file)
--- a/
json-lexer.c
+++ b/
json-lexer.c
@@
-284,8
+284,6
@@
void json_lexer_init(JSONLexer *lexer, JSONLexerEmitter func)
static int json_lexer_feed_char(JSONLexer *lexer, char ch)
{
- char buf[2];
-
lexer->x++;
if (ch == '\n') {
lexer->x = 0;
@@
-313,10
+311,7
@@
static int json_lexer_feed_char(JSONLexer *lexer, char ch)
break;
}
- buf[0] = ch;
- buf[1] = 0;
-
- qstring_append(lexer->token, buf);
+ qstring_append_chr(lexer->token, ch);
return 0;
}