From d72b8d8399ea5185eae2c8717cd5e6db6b27d939 Mon Sep 17 00:00:00 2001 From: Congcong Cai Date: Tue, 2 Dec 2025 13:16:45 +0800 Subject: [PATCH] [NFC] replace macro with lambda in json.hpp --- src/support/json.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/support/json.h b/src/support/json.h index 0ddc4865467..23d0749f045 100644 --- a/src/support/json.h +++ b/src/support/json.h @@ -271,14 +271,15 @@ struct Value { }; char* parse(char* curr, StringEncoding stringEncoding) { -#define is_json_space(x) \ - (x == 32 || x == 9 || x == 10 || \ - x == 13) /* space, tab, linefeed/newline, or return */ -#define skip() \ - { \ - while (*curr && is_json_space(*curr)) \ - curr++; \ - } + auto is_json_space = [](char x) -> bool { + return x == 32 || x == 9 || x == 10 || + x == 13; /* space, tab, linefeed/newline, or return */ + }; + auto skip = [&]() -> void { + while (*curr && is_json_space(*curr)) { + curr++; + } + }; skip(); if (*curr == '"') { // String