From 0b7c29f1517cfd5198bbaf54d81ef7fb4c4fe53e Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Sun, 17 Aug 2025 13:12:57 -0400 Subject: [PATCH] Use consistent style in data callbacks --- src/commit_request.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);