pub struct SharedRegion {
pub occurrences: Vec<RegionSide>,
pub statements: u32,
}Expand description
One duplicated run and every place it occurs.
A run copied into n places produces n * (n - 1) / 2 pairwise matches
that all describe the same duplication, so the pairs are collapsed into the
occurrence set they imply. Every occurrence in the set holds the same
statement summaries as every other, not merely as its neighbours: see
consolidate for why grouping by transitive closure is sound here and
would not be for an approximate match.
Fields§
§occurrences: Vec<RegionSide>Where the run occurs, at least twice, in ascending order.
statements: u32Length of the run, in statements; the same at every occurrence.
Trait Implementations§
Source§fn clone(&self) -> SharedRegion
fn clone(&self) -> SharedRegion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§fn cmp(&self, other: &SharedRegion) -> Ordering
fn cmp(&self, other: &SharedRegion) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.