MCPcopy Create free account
hub / github.com/davidblewett/rure-python / symmetric_difference

Method symmetric_difference

regex/regex-syntax/src/hir/interval.rs:229–235  ·  view source on GitHub ↗

Compute the symmetric difference of the two sets, in place. This computes the symmetric difference of two interval sets. This removes all elements in this set that are also in the given set, but also adds all elements from the given set that aren't in this set. That is, the set will contain all elements in either set, but will not contain any elements that are in both sets.

(&mut self, other: &IntervalSet<I>)

Source from the content-addressed store, hash-verified

227 /// set. That is, the set will contain all elements in either set,
228 /// but will not contain any elements that are in both sets.
229 pub fn symmetric_difference(&mut self, other: &IntervalSet<I>) {
230 // TODO(burntsushi): Fix this so that it amortizes allocation.
231 let mut intersection = self.clone();
232 intersection.intersect(other);
233 self.union(other);
234 self.difference(&intersection);
235 }
236
237 /// Negate this interval set.
238 ///

Callers

nothing calls this directly

Calls 4

cloneMethod · 0.80
intersectMethod · 0.45
unionMethod · 0.45
differenceMethod · 0.45

Tested by

no test coverage detected