Skip to content

Commit

Permalink
Minor improvements to comments in selection.rs (helix-editor#11101)
Browse files Browse the repository at this point in the history
  • Loading branch information
matta authored and mxxntype committed Aug 14, 2024
1 parent 4e0bd27 commit 767a928
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion helix-core/src/selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl Range {
/// function runs in O(N) (N is number of changes) and can therefore
/// cause performance problems if run for a large number of ranges as the
/// complexity is then O(MN) (for multicuror M=N usually). Instead use
/// [Selection::map] or [ChangeSet::update_positions] instead
/// [Selection::map] or [ChangeSet::update_positions].
pub fn map(mut self, changes: &ChangeSet) -> Self {
use std::cmp::Ordering;
if changes.is_empty() {
Expand Down Expand Up @@ -541,6 +541,8 @@ impl Selection {
}

/// Normalizes a `Selection`.
///
/// Ranges are sorted by [Range::from], with overlapping ranges merged.
fn normalize(mut self) -> Self {
if self.len() < 2 {
return self;
Expand Down

0 comments on commit 767a928

Please sign in to comment.