Skip to content

Commit

Permalink
[lib] Fixed assymetry between {startsWith} and {endsWith}
Browse files Browse the repository at this point in the history
  • Loading branch information
linxuanm committed Jan 11, 2025
1 parent c936bc5 commit 279c53a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util/Ranges.v3
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ component Ranges {
}
// Check if {range} ends with {end}, i.e. the latter is a suffix.
def endsWith<T>(range: Range<T>, end: Range<T>) -> bool {
if (range.length <= end.length) return false;
if (range.length < end.length) return false;
for (i < end.length) {
if (range[range.length - i - 1] != end[end.length - i - 1]) return false;
}
Expand Down

0 comments on commit 279c53a

Please sign in to comment.