diff --git a/src/commit_request.cpp b/src/commit_request.cpp index 57697c1..37e2353 100644 --- a/src/commit_request.cpp +++ b/src/commit_request.cpp @@ -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);