Remove certain TODOs

This commit is contained in:
Timofey Solomko
2018-04-10 23:26:35 +03:00
parent a0ef7a3cfe
commit 41ca39d1fa
2 changed files with 2 additions and 4 deletions
+2 -3
View File
@@ -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,
-1
View File
@@ -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 &&