Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed totalCostLimit from MemoryConfig #184

Merged
merged 1 commit into from
May 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions Source/Shared/Configuration/MemoryConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ public struct MemoryConfig {
public let expiry: Expiry
/// The maximum number of objects in memory the cache should hold. 0 means no limit.
public let countLimit: UInt
/// The maximum total cost that the cache can hold before it starts evicting objects. 0 means no limit.
public let totalCostLimit: UInt

public init(expiry: Expiry = .never, countLimit: UInt = 0, totalCostLimit: UInt = 0) {
public init(expiry: Expiry = .never, countLimit: UInt = 0) {
self.expiry = expiry
self.countLimit = countLimit
self.totalCostLimit = totalCostLimit
}

// MARK: - Deprecated
@available(*, deprecated,
message: "Use init(expiry:countLimit:) instead.",
renamed: "init(expiry:countLimit:)")
public init(expiry: Expiry = .never, countLimit: UInt = 0, totalCostLimit: UInt = 0) {
self.init(expiry: expiry, countLimit: countLimit)
}
}
1 change: 0 additions & 1 deletion Source/Shared/Storage/MemoryStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ final class MemoryStorage {
init(config: MemoryConfig) {
self.config = config
self.cache.countLimit = Int(config.countLimit)
self.cache.totalCostLimit = Int(config.totalCostLimit)
}
}

Expand Down