mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
0c99d9f20c
Replace the large 500+ line switch statement in mrb_str_format with a clean lookup table dispatch system for better code organization and maintainability. Changes: - Add format specifier lookup table (format_table[128]) - Define format types (FMT_FLAG, FMT_CHAR, FMT_INTEGER, etc.) - Replace character-by-character dispatch with O(1) table lookup - Maintain identical behavior (all 1723 tests pass) This improves code readability by separating format specification (data) from handling logic (code), making it easier to understand and maintain the sprintf implementation. Co-authored-by: Claude <noreply@anthropic.com>