Use consistent style in data callbacks

This commit is contained in:
2025-08-17 13:12:57 -04:00
parent 6775276e73
commit 0b7c29f151

View File

@@ -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);