[Shared] Adds OperatingSystemVersion+Comparable to AltServer target

This commit is contained in:
Riley Testut
2022-11-21 16:48:45 -06:00
committed by Magesh K
parent 3c02938bfd
commit 2f9f3e6c72
2 changed files with 3 additions and 0 deletions

View File

@@ -1,18 +0,0 @@
//
// OperatingSystemVersion+Comparable.swift
// AltStoreCore
//
// Created by nythepegasus on 5/9/24.
//
import Foundation
extension OperatingSystemVersion: Comparable {
public static func ==(lhs: OperatingSystemVersion, rhs: OperatingSystemVersion) -> Bool {
return lhs.majorVersion == rhs.majorVersion && lhs.minorVersion == rhs.minorVersion && lhs.patchVersion == rhs.patchVersion
}
public static func <(lhs: OperatingSystemVersion, rhs: OperatingSystemVersion) -> Bool {
return lhs.stringValue.compare(rhs.stringValue, options: .numeric) == .orderedAscending
}
}