From 1fde37bb914c853c40514eaf8b722164f5ed88d0 Mon Sep 17 00:00:00 2001 From: Matthew Reschke Date: Sun, 21 Jun 2026 21:22:41 -0600 Subject: [PATCH] Add a comment above the Dictionary Dispatch call --- speedtest-hd.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/speedtest-hd.py b/speedtest-hd.py index 96090fc..40dbc60 100755 --- a/speedtest-hd.py +++ b/speedtest-hd.py @@ -715,6 +715,10 @@ def main(argv: Optional[Sequence[str]] = None) -> int: confirm(cfg) + # Dictionary dispatch: map each mode name to its handler function (the values + # are the functions themselves -- no parentheses), look up the one for `mode`, + # then call it with (cfg). Equivalent to an if/elif chain over `mode`. `mode` + # is always one of these three keys by now, so the lookup can't KeyError. {"cdm": cdm_profile, "slog": slog_profile, "dd": dd_profile}[mode](cfg) return 0