Opened 11 years ago
Closed 10 years ago
#383 closed defect (fixed)
Konami code detection takes quadratic time in number of keystrokes
Reported by: | andersk | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | pony | Keywords: | |
Cc: |
Description
scripts-pony/scripts/templates/master.mak has a very inefficient Konami code detection easter egg that appends all keystrokes to a JavaScript? array. It should be rewritten to use the obvious 11-state Knuth–Morris–Pratt FSM.
This now also affects XVM, who copied this code.
Change History (1)
comment:1 Changed 10 years ago by andersk
- Resolution set to fixed
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.
Fixed by https://scripts.mit.edu/gitweb/scripts-pony.git/commitdiff/c268ba3fe3c1ba854680091176432e249804941d.