Skip to content

Commit

Permalink
Rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Jul 9, 2020
1 parent 5bb7397 commit 983f6aa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/edits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ where
let mut annotated_minus_lines = Vec::<Vec<(EditOperation, &str)>>::new();
let mut annotated_plus_lines = Vec::<Vec<(EditOperation, &str)>>::new();

let mut emitted = 0; // plus lines emitted so far
let mut plus_index = 0; // plus lines emitted so far

'minus_lines_loop: for minus_line in minus_lines {
let mut considered = 0; // plus lines considered so far as match for minus_line
for plus_line in &plus_lines[emitted..] {
for plus_line in &plus_lines[plus_index..] {
let alignment = align::Alignment::new(
tokenize(minus_line, tokenization_regex),
tokenize(plus_line, tokenization_regex),
Expand All @@ -55,13 +55,13 @@ where
// minus_line and plus_line are inferred to be a homologous pair.

// Emit as unpaired the plus lines already considered and rejected
for plus_line in &plus_lines[emitted..(emitted + considered)] {
for plus_line in &plus_lines[plus_index..(plus_index + considered)] {
annotated_plus_lines.push(vec![(noop_insertion, plus_line)]);
}
emitted += considered;
plus_index += considered;
annotated_minus_lines.push(annotated_minus_line);
annotated_plus_lines.push(annotated_plus_line);
emitted += 1;
plus_index += 1;

// Greedy: move on to the next minus line.
continue 'minus_lines_loop;
Expand All @@ -73,7 +73,7 @@ where
annotated_minus_lines.push(vec![(noop_deletion, minus_line)]);
}
// Emit any remaining plus lines
for plus_line in &plus_lines[emitted..] {
for plus_line in &plus_lines[plus_index..] {
annotated_plus_lines.push(vec![(noop_insertion, plus_line)]);
}

Expand Down

0 comments on commit 983f6aa

Please sign in to comment.