From 5b32cbf089f2f06e968be1a7d98a6581aaf77e28 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sun, 26 Oct 2025 19:16:12 +0900 Subject: [PATCH] mruby-strftime: combine variable declaration with initialization --- mrbgems/mruby-strftime/src/strftime.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mrbgems/mruby-strftime/src/strftime.c b/mrbgems/mruby-strftime/src/strftime.c index 1f4c37313..e328d30f7 100644 --- a/mrbgems/mruby-strftime/src/strftime.c +++ b/mrbgems/mruby-strftime/src/strftime.c @@ -44,17 +44,13 @@ mrb_time_strftime(mrb_state *mrb, mrb_value self) { const char *format; mrb_int format_len; - struct tm *tm; - mrb_value result; - const char *fmt_ptr; - mrb_int remaining; mrb_get_args(mrb, "s", &format, &format_len); - tm = mrb_time_get_tm(mrb, self); + struct tm *tm = mrb_time_get_tm(mrb, self); - result = mrb_str_new(mrb, NULL, 0); - fmt_ptr = format; - remaining = format_len; + mrb_value result = mrb_str_new(mrb, NULL, 0); + const char *fmt_ptr = format; + mrb_int remaining = format_len; /* Process format string in segments, handling NUL bytes */ while (remaining > 0) {