Commit e5cf41c
committed
simplify matchplus and matchstar
`matchplus` can be simplified by only modifying `matchlength` once the complete match is successful. This means it doesn't have to rewind `matchlength` as it iterates through each possible `matchpattern`. This also means it keeps `matchlength` unmodified if it doesn't return a match. Because of this last part, this also means that `matchstar` can leverage `matchplus` which reduces it to single line of code `return matchplus(...) || matchpattern(..)`.1 parent 711981b commit e5cf41c
1 file changed
+7
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
400 | | - | |
| 400 | + | |
401 | 401 | | |
402 | | - | |
403 | 402 | | |
404 | 403 | | |
405 | 404 | | |
406 | 405 | | |
407 | | - | |
408 | 406 | | |
409 | | - | |
| 407 | + | |
410 | 408 | | |
411 | | - | |
| 409 | + | |
| 410 | + | |
412 | 411 | | |
413 | | - | |
| 412 | + | |
414 | 413 | | |
415 | | - | |
416 | | - | |
417 | 414 | | |
418 | 415 | | |
419 | 416 | | |
420 | | - | |
| 417 | + | |
421 | 418 | | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
| 419 | + | |
436 | 420 | | |
437 | 421 | | |
438 | 422 | | |
| |||
0 commit comments