diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-05 09:25:30 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-05 09:25:30 -0500 |
| commit | 2670384cb90392147054a896d297d808a021e7ce (patch) | |
| tree | eb0c8f83a59b515c214cc44f323aa485dfd66270 /test-from-git | |
| parent | 1a89ea4cae26d37f584aa8c4266cb4bb9aaa9a0f (diff) | |
| download | org-drill-2670384cb90392147054a896d297d808a021e7ce.tar.gz org-drill-2670384cb90392147054a896d297d808a021e7ce.zip | |
refactor: convert spanish-verb 6-way cl-case to alist dispatch
org-drill-present-spanish-verb had a 6-branch cl-case where each
branch differed only in two values: which subheading to reveal
(Infinitive or English) and which prompt string to show. Inlined
into a 50-line block of nearly-identical setq calls.
Extracted the (reveal . prompt) pairs into a defconst alist and
reduced the dispatcher to a random-pick + apply-pair pattern.
Function drops from 51 lines to 14. Existing branch tests still
pass — they mock cl-random to a specific index, and the alist's
order matches the previous case order.
Diffstat (limited to 'test-from-git')
0 files changed, 0 insertions, 0 deletions
