Skip to content

Commit

Permalink
Undo lazy
Browse files Browse the repository at this point in the history
  • Loading branch information
hughbe committed Oct 6, 2020
1 parent 10bfa4f commit fa95635
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Sources/CompoundFileReader/CompoundFile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public class CompoundFile {
miniSectorSize = UInt32(pow(2, Double(header.miniSectorShift)))
}

public lazy var rootStorage: CompoundFileStorage = {
public var rootStorage: CompoundFileStorage {
return getStorage(entryID: 0)!
}()
}

public func getStorage(entryID: UInt32) -> CompoundFileStorage? {
if entryID == 0xFFFFFFFF {
Expand Down
4 changes: 2 additions & 2 deletions Sources/CompoundFileReader/CompoundFileStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public struct CompoundFileStorage: CustomDebugStringConvertible {
return entry.name
}

public lazy var children: [String: CompoundFileStorage] = {
public var children: [String: CompoundFileStorage] {
guard let child = file.getStorage(entryID: entry.childID) else {
return [:]
}
Expand All @@ -25,7 +25,7 @@ public struct CompoundFileStorage: CustomDebugStringConvertible {
result[child.name] = child
child.addSiblings(to: &result)
return result
}()
}

private func addSiblings(to: inout [String: CompoundFileStorage]) {
let leftID = entry.leftSiblingID
Expand Down

0 comments on commit fa95635

Please sign in to comment.