Use consistent style in data callbacks
This commit is contained in:
@@ -195,7 +195,7 @@ void CommitRequest::on_string_data(void *userdata, const char *buf, int len,
|
||||
if (ctx.parse_error)
|
||||
return;
|
||||
|
||||
if (ctx.current_string.size() == 0 && done) {
|
||||
if (done && ctx.current_string.empty()) {
|
||||
self->handle_completed_string(std::string_view(buf, len));
|
||||
} else {
|
||||
ctx.current_string.append(buf, len);
|
||||
@@ -268,7 +268,7 @@ void CommitRequest::on_number_data(void *userdata, const char *buf, int len,
|
||||
if (ctx.parse_error)
|
||||
return;
|
||||
|
||||
if (ctx.current_number.size() == 0 && done) {
|
||||
if (done && ctx.current_number.empty()) {
|
||||
self->handle_completed_number(std::string_view(buf, len));
|
||||
} else {
|
||||
ctx.current_number.append(buf, len);
|
||||
|
||||
Reference in New Issue
Block a user