8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b05de7 commit 738ca60Copy full SHA for 738ca60
Xit/Repository/OID.swift
@@ -170,13 +170,17 @@ extension GitOID: CustomStringConvertible
170
public var description: String { sha }
171
}
172
173
+let oidSize = 20
174
+
175
public func == (left: GitOID, right: GitOID) -> Bool
176
{
177
left.withUnsafeOID {
178
(leftOID) in
179
right.withUnsafeOID {
180
(rightOID) in
- git_oid_equal(leftOID, rightOID) != 0
181
+ // git_oid_equal() is slowed down by the use of git_oid_size(), which isn't
182
+ // even needed with SHA256 support turned off
183
+ memcmp(leftOID, rightOID, oidSize) == 0
184
185
186
0 commit comments