Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-bodnar authored Feb 6, 2025
1 parent ed6d309 commit b1433ab
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
1 change: 0 additions & 1 deletion Sources/CrowdinSDK/CrowdinFileSystem/File.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class ReadWriteFile<T: ReadWriteProtocol>: File {
guard let file = self.file else { return }
file.write(to: self.path)
}

func read() {
self.file = T.read(from: self.path)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ final class FileEtagStorage: AnyEtagStorage {
dictionaryFile.read()
return (dictionaryFile.file as? [String: [String: String]]) ?? [:]
}

init(localization: String) {
self.localization = localization
let path = CrowdinFolder.shared.path + "/" + FileEtagStorage.fileName
Expand All @@ -26,7 +25,6 @@ final class FileEtagStorage: AnyEtagStorage {
dictionaryFile.create()
}
}

func save(etag: String?, for file: String) {
queue.sync {
var currentEtags = getEtags()
Expand All @@ -37,14 +35,12 @@ final class FileEtagStorage: AnyEtagStorage {
try? self.dictionaryFile.save()
}
}

func etag(for file: String) -> String? {
queue.sync {
let currentEtags = getEtags()
return currentEtags[localization]?[file]
}
}

func clear() {
queue.sync {
var currentEtags = getEtags()
Expand All @@ -53,7 +49,6 @@ final class FileEtagStorage: AnyEtagStorage {
try? self.dictionaryFile.save()
}
}

func clear(for file: String) {
queue.sync {
var currentEtags = getEtags()
Expand All @@ -64,7 +59,6 @@ final class FileEtagStorage: AnyEtagStorage {
try? self.dictionaryFile.save()
}
}

/// Remove file
static func clear() {
let path = CrowdinFolder.shared.path + "/" + FileEtagStorage.fileName
Expand Down

0 comments on commit b1433ab

Please sign in to comment.