about summary refs log tree commit diff
path: root/tests/rustdoc-js-std
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2023-11-20 13:15:47 -0700
committerMichael Howell <michael@notriddle.com>2023-11-21 13:09:53 -0700
commitd82a08537aab25f3d1d43a30ea4b06422819bbfd (patch)
tree9b16264b9a35c0bcdc5aa4754b824ee715db8cdb /tests/rustdoc-js-std
parent2f8d81f9dbac6b8df982199f69da04a4c8357227 (diff)
downloadrust-d82a08537aab25f3d1d43a30ea4b06422819bbfd.tar.gz
rust-d82a08537aab25f3d1d43a30ea4b06422819bbfd.zip
rustdoc-search: clean up `checkPath`
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.
Diffstat (limited to 'tests/rustdoc-js-std')
0 files changed, 0 insertions, 0 deletions