mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
Remove certain TODOs
This commit is contained in:
@@ -8,7 +8,6 @@ import BitByteData
|
||||
|
||||
// While it is tempting to make Provider conform to `IteratorProtocol` and `Sequence` protocols, it is in fact
|
||||
// impossible to do so, since `TarEntryInfo.init(...)` is throwing and `IteratorProtocol.next()` cannot be throwing.
|
||||
// TODO: Struct or class?
|
||||
struct TarEntryInfoProvider {
|
||||
|
||||
private let byteReader: ByteReader
|
||||
@@ -22,8 +21,8 @@ struct TarEntryInfoProvider {
|
||||
}
|
||||
|
||||
mutating func next() throws -> TarEntryInfo? {
|
||||
// TODO: Check, if bytes left is >= 1024.
|
||||
guard byteReader.data[byteReader.offset..<byteReader.offset + 1024] != Data(count: 1024)
|
||||
guard byteReader.bytesLeft >= 1024,
|
||||
byteReader.data[byteReader.offset..<byteReader.offset + 1024] != Data(count: 1024)
|
||||
else { return nil }
|
||||
|
||||
let info = try TarEntryInfo(byteReader, lastGlobalExtendedHeader, lastLocalExtendedHeader,
|
||||
|
||||
@@ -130,7 +130,6 @@ struct ZipLocalHeader {
|
||||
guard cdEntry.diskNumberStart == currentDiskNumber
|
||||
else { throw ZipError.multiVolumesNotSupported }
|
||||
|
||||
// TODO: Maybe local header should "overwrite" Central Directory values?
|
||||
// Check if Local Header is consistent with Central Directory record.
|
||||
guard self.generalPurposeBitFlags == cdEntry.generalPurposeBitFlags &&
|
||||
self.compressionMethod == cdEntry.compressionMethod &&
|
||||
|
||||
Reference in New Issue
Block a user