Commit 63164b7
committed
rustdoc-search: clean up
This computes the same result with less code by computing many of
the old checks at once:
* It won't enter the loop if clength > length, because then the
result of length - clength will be negative and the
loop conditional will fail.
* i + clength will never be greater than length, because it
starts out as i = length - clength, implying that i + clength
equals length, and it only goes down from there.
* The aborted variable is replaced with control flow.checkPath
1 parent 46ecc10 commit 63164b7
1 file changed
+3
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1648 | 1648 | | |
1649 | 1649 | | |
1650 | 1650 | | |
1651 | | - | |
1652 | | - | |
1653 | | - | |
1654 | | - | |
1655 | | - | |
1656 | | - | |
1657 | | - | |
| 1651 | + | |
1658 | 1652 | | |
1659 | | - | |
1660 | 1653 | | |
1661 | 1654 | | |
1662 | 1655 | | |
1663 | | - | |
1664 | | - | |
| 1656 | + | |
1665 | 1657 | | |
1666 | 1658 | | |
1667 | 1659 | | |
1668 | | - | |
1669 | | - | |
1670 | | - | |
| 1660 | + | |
1671 | 1661 | | |
1672 | 1662 | | |
1673 | 1663 | | |
| |||
0 commit comments