From 24341f6b9c3ca9983b510131ddd9fecea43755e1 Mon Sep 17 00:00:00 2001 From: Enkidu93 Date: Mon, 6 Oct 2025 13:21:45 -0400 Subject: [PATCH] Remove scripture ref comparer since it's unused --- .../Corpora/ScriptureRefComparer.cs | 37 ------------------- 1 file changed, 37 deletions(-) delete mode 100644 src/SIL.Machine/Corpora/ScriptureRefComparer.cs diff --git a/src/SIL.Machine/Corpora/ScriptureRefComparer.cs b/src/SIL.Machine/Corpora/ScriptureRefComparer.cs deleted file mode 100644 index e3e7cc7c..00000000 --- a/src/SIL.Machine/Corpora/ScriptureRefComparer.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Collections.Generic; -using SIL.Extensions; -using SIL.Machine.Corpora; - -public class ScriptureRefComparer : IComparer, IEqualityComparer -{ - public static ScriptureRefComparer Default { get; } = new ScriptureRefComparer(compareSegments: true); - public static ScriptureRefComparer IgnoreSegments { get; } = new ScriptureRefComparer(compareSegments: false); - private readonly bool _compareSegments; - - public ScriptureRefComparer(bool compareSegments = true) - { - _compareSegments = compareSegments; - } - - public int Compare(ScriptureRef x, ScriptureRef y) - { - return x.CompareTo(y, _compareSegments); - } - - public bool Equals(ScriptureRef x, ScriptureRef y) - { - return x.CompareTo(y, _compareSegments) == 0; - } - - public int GetHashCode(ScriptureRef obj) - { - int hashCode = 23; - hashCode = - hashCode * 31 - + (_compareSegments ? obj.VerseRef.BBBCCCVVVS.GetHashCode() : obj.VerseRef.BBBCCCVVV.GetHashCode()); - hashCode = hashCode * 31 + obj.Versification.GetHashCode(); - // Using ToRelaxed is necessary to maintain equality across relaxed refs, Equals properly handles relaxed ref comparison - hashCode = hashCode * 31 + obj.ToRelaxed().Path.GetSequenceHashCode(); - return hashCode; - } -}