mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-06 19:00:27 +08:00
valid_type() rebuilt an 18-entry list of patterns and ran up to 18 uncompiled re.match() calls for every pin line in every hwdef. Compile the alternation once as a class member instead. get_mcu_lib() called importlib.import_module() every time, which is also once per pin line; remember the module we found. Together these take processing all 443 ChibiOS hwdefs from 0.45s to 0.40s. The parse state of all 490 boards is unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>