Rearrange code to be more consistent
This commit is contained in:
parent
71e0498c49
commit
501ca2fd5f
2 changed files with 54 additions and 54 deletions
|
|
@ -11,10 +11,6 @@ use std::ops::{Index, Range};
|
|||
|
||||
use crate::algorithms::DiffHook;
|
||||
|
||||
fn modulo(a: isize, b: usize) -> usize {
|
||||
a.rem_euclid(b as isize) as usize
|
||||
}
|
||||
|
||||
/// Myers' diff algorithm.
|
||||
///
|
||||
/// Diff `old`, between indices `old_range` and `new` between indices `new_range`.
|
||||
|
|
@ -52,6 +48,10 @@ where
|
|||
diff(d, old, 0..old.len(), new, 0..new.len())
|
||||
}
|
||||
|
||||
fn modulo(a: isize, b: usize) -> usize {
|
||||
a.rem_euclid(b as isize) as usize
|
||||
}
|
||||
|
||||
pub(crate) fn diff_offsets<D, Old, New>(
|
||||
diff: &mut D,
|
||||
old: &Old,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue