Skip to content

Commit

Permalink
Fix brave/brave-ios#8261: Performance issue of `BraveCertificateUtils…
Browse files Browse the repository at this point in the history
….formatDate(_:)` (brave/brave-ios#8262)
  • Loading branch information
thai-d-v authored Oct 24, 2023
1 parent 3d8b744 commit 693b4f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/CertificateUtilities/BraveCertificateUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ public struct BraveCertificateUtils {
return result
}

public static func formatDate(_ date: Date) -> String {
private static let dateFormatter: DateFormatter = {
let dateFormatter = DateFormatter()
dateFormatter.dateStyle = .full
dateFormatter.timeStyle = .full
return dateFormatter
}()

public static func formatDate(_ date: Date) -> String {
return dateFormatter.string(from: date)
}
}
Expand Down

0 comments on commit 693b4f5

Please sign in to comment.