mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
26 lines
497 B
Swift
26 lines
497 B
Swift
// Copyright (c) 2026 Timofey Solomko
|
|
// Licensed under MIT License
|
|
//
|
|
// See LICENSE for license information
|
|
|
|
import Foundation
|
|
|
|
struct CodeLength: Equatable {
|
|
|
|
let symbol: Int
|
|
let codeLength: Int
|
|
|
|
}
|
|
|
|
extension CodeLength: Comparable {
|
|
|
|
static func < (left: CodeLength, right: CodeLength) -> Bool {
|
|
if left.codeLength == right.codeLength {
|
|
return left.symbol < right.symbol
|
|
} else {
|
|
return left.codeLength < right.codeLength
|
|
}
|
|
}
|
|
|
|
}
|