From 1270b9a8d819487095b622fce3807728205d86a0 Mon Sep 17 00:00:00 2001 From: DanielEScherzer Date: Tue, 10 Sep 2024 14:10:42 -0700 Subject: [PATCH] php_reflection.c: remove unneeded do-while in `DUMP_CONST_FLAG` macro The do-while trick is used to allow including multiple statements where only one is expected, but in this case we know that the uses on the next few lines permit including multiple statements, so the extra do-while wrapper is unneeded. --- ext/reflection/php_reflection.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 289c9392124e9..a3786cbaad888 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -556,13 +556,11 @@ static void _const_string(smart_str *str, char *name, zval *value, char *indent) smart_str_appends(str, "<"); #define DUMP_CONST_FLAG(flag, output) \ - do { \ - if (flags & flag) { \ - if (!first) smart_str_appends(str, ", "); \ - smart_str_appends(str, output); \ - first = false; \ - } \ - } while (0) + if (flags & flag) { \ + if (!first) smart_str_appends(str, ", "); \ + smart_str_appends(str, output); \ + first = false; \ + } DUMP_CONST_FLAG(CONST_PERSISTENT, "persistent"); DUMP_CONST_FLAG(CONST_NO_FILE_CACHE, "no_file_cache"); DUMP_CONST_FLAG(CONST_DEPRECATED, "deprecated");