Skip to content

Commit

Permalink
Remove a loop which runs exactly once
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyMikh committed Oct 27, 2019
1 parent 23f890f commit 159d8a4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/librustc_errors/emitter.rs
Expand Up @@ -1817,10 +1817,9 @@ impl FileWithAnnotatedLines {
// Every `|` that joins the beginning of the span (`___^`) to the end (`|__^`).
add_annotation_to_file(&mut output, file.clone(), line, ann.as_line());
}
if middle < ann.line_end - 1 {
for line in ann.line_end - 1..ann.line_end {
add_annotation_to_file(&mut output, file.clone(), line, ann.as_line());
}
let line_end = ann.line_end - 1;
if middle < line_end {
add_annotation_to_file(&mut output, file.clone(), line_end, ann.as_line());
}
} else {
end_ann.annotation_type = AnnotationType::Singleline;
Expand Down

0 comments on commit 159d8a4

Please sign in to comment.