MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / eq

Method eq

atomic-core/src/diff/line.rs:329–337  ·  view source on GitHub ↗

Compare two lines for equality. Uses hash-based pre-filtering for performance: 1. If hashes differ, lines are definitely different (fast path) 2. If hashes match, compare bytes to handle collisions This comparison is **strict** - lines must match exactly including any trailing newline. For lenient comparison, use [`equals`](Self::equals).

(&self, other: &Self)

Source from the content-addressed store, hash-verified

327 /// This comparison is **strict** - lines must match exactly including
328 /// any trailing newline. For lenient comparison, use [`equals`](Self::equals).
329 fn eq(&self, other: &Self) -> bool {
330 // Fast path: different hashes means definitely not equal
331 if self.hash != other.hash {
332 return false;
333 }
334
335 // Hashes match, compare content (handles hash collisions)
336 self.content == other.content
337 }
338}
339
340impl<'a> Eq for Line<'a> {}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected