Use a sorted vector for block comments (#9337)

## Summary

I realized that we can avoid allocating a hash map here.
This commit is contained in:
Charlie Marsh 2023-12-31 15:52:40 -04:00 committed by GitHub
parent 686abbc97a
commit cea2ec8dd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View file

@ -54,8 +54,8 @@ impl CommentRanges {
/// own-line comments in which the comment hash (`#`) appears in the same
/// column in each line, and at least one comment is non-empty.
///
/// Returns a vector containing the offset of the leading hash (`#`) for
/// each comment in any block comment.
/// Returns a sorted vector containing the offset of the leading hash (`#`)
/// for each comment in any block comment.
///
/// ## Examples
/// ```python