Files
SWCompression/Sources/Common/CodingTree/CodeLength.swift
T
2026-01-31 15:30:24 +08:00

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
}
}
}