Skip to content
Commit 56686ec4 authored by Shao-Ce SUN's avatar Shao-Ce SUN
Browse files

[NFC][ADT] Tweaked some functions in StringRef

Reduced the usage of variables in the `rfind` and `count` functions.

Replaced calls to `drop_front` with direct use of `substr` in `consume_front`,
since `starts_with` already performs length check on the string. Did the same
for other functions.

Using the `std::clamp` in `slice` makes the code more straightforward.

Reviewed By: bkramer

Differential Revision: https://reviews.llvm.org/D144787
parent 06c86025
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment