Add swiftlint & Minor fixes

This commit is contained in:
世界
2025-11-27 16:10:55 +08:00
parent 8855e0eef9
commit 0bfb6d2516
29 changed files with 382 additions and 196 deletions
@@ -2,7 +2,7 @@ import Foundation
import Libbox
import SwiftUI
public struct OutboundGroup: Codable {
public struct OutboundGroup: Codable, Hashable {
let tag: String
let type: String
var selected: String
@@ -10,13 +10,16 @@ public struct OutboundGroup: Codable {
var isExpand: Bool
let items: [OutboundGroupItem]
var hashValue: Int {
var value = tag.hashValue
(value, _) = value.addingReportingOverflow(selected.hashValue)
public func hash(into hasher: inout Hasher) {
hasher.combine(tag)
hasher.combine(selected)
for item in items {
(value, _) = value.addingReportingOverflow(item.urlTestTime.hashValue)
hasher.combine(item.urlTestTime)
}
return value
}
public static func == (lhs: OutboundGroup, rhs: OutboundGroup) -> Bool {
lhs.hashValue == rhs.hashValue
}
}