mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
Rename some variables for consistency
This commit is contained in:
@@ -197,7 +197,7 @@ public class SevenZipContainer {
|
||||
- Returns: Array of `SevenZipEntryInfo`.
|
||||
*/
|
||||
public static func info(container data: Data) throws -> [SevenZipEntryInfo] {
|
||||
var entryInfos = [SevenZipEntryInfo]()
|
||||
var entries = [SevenZipEntryInfo]()
|
||||
guard let header = try readHeader(data)
|
||||
else { return [] }
|
||||
|
||||
@@ -207,17 +207,17 @@ public class SevenZipContainer {
|
||||
var nonEmptyFileIndex = 0
|
||||
for file in files {
|
||||
if !file.isEmptyStream, let substreamInfo = header.mainStreams?.substreamInfo {
|
||||
entryInfos.append(SevenZipEntryInfo(file,
|
||||
entries.append(SevenZipEntryInfo(file,
|
||||
substreamInfo.unpackSizes[nonEmptyFileIndex],
|
||||
substreamInfo.digests[nonEmptyFileIndex]))
|
||||
nonEmptyFileIndex += 1
|
||||
} else {
|
||||
let info = file.isEmptyFile ? SevenZipEntryInfo(file, 0) : SevenZipEntryInfo(file)
|
||||
entryInfos.append(info)
|
||||
entries.append(info)
|
||||
}
|
||||
}
|
||||
|
||||
return entryInfos
|
||||
return entries
|
||||
}
|
||||
|
||||
private static func readHeader(_ data: Data) throws -> SevenZipHeader? {
|
||||
|
||||
@@ -24,7 +24,6 @@ public class TarContainer: Container {
|
||||
*/
|
||||
public static func open(container data: Data) throws -> [TarEntry] {
|
||||
let infos = try info(container: data)
|
||||
|
||||
var entries = [TarEntry]()
|
||||
|
||||
for infoEntry in infos {
|
||||
|
||||
@@ -29,8 +29,8 @@ public class ZipContainer: Container {
|
||||
var entries = [ZipEntry]()
|
||||
|
||||
for infoEntry in infos {
|
||||
let data = try ZipContainer.getEntryData(from: data, using: infoEntry)
|
||||
entries.append(ZipEntry(infoEntry, data))
|
||||
let entryData = try ZipContainer.getEntryData(from: data, using: infoEntry)
|
||||
entries.append(ZipEntry(infoEntry, entryData))
|
||||
}
|
||||
|
||||
return entries
|
||||
|
||||
Reference in New Issue
Block a user