Commit d0c52ea
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 d0c52ea
1 file changed
+5
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
| 402 | + | |
418 | 403 | | |
419 | 404 | | |
420 | 405 | | |
| |||
423 | 408 | | |
424 | 409 | | |
425 | 410 | | |
426 | | - | |
427 | 411 | | |
428 | | - | |
| 412 | + | |
429 | 413 | | |
430 | | - | |
| 414 | + | |
| 415 | + | |
431 | 416 | | |
432 | | - | |
| 417 | + | |
433 | 418 | | |
434 | | - | |
435 | 419 | | |
436 | 420 | | |
437 | 421 | | |
| |||
0 commit comments