Files
SWCompression/Sources/Common/CodingTree/CodeLength.swift
T
2023-02-07 15:31:45 +02:00

26 lines
497 B
Swift

// Copyright (c) 2023 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
}
}
}