Skip to content

Commit ebeda16

Browse files
committed
don't copy comment location in a loop
1 parent 151b985 commit ebeda16

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler-core/src/parse/extra.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ impl ModuleExtra {
6464
let mut best = None;
6565
let mut search_list = &self.comments[..];
6666
while let Some(index) = inner(search_list, start, end) {
67-
best = self.comments.get(index).copied();
67+
best = self.comments.get(index);
6868
search_list = search_list.get(0..index).unwrap_or(&[]);
6969
}
70-
best
70+
best.copied()
7171
}
7272
}
7373

0 commit comments

Comments
 (0)