Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Fix #8261: performance issue of BraveCertificateUtils.formatDate(_:) #8262

Merged
Merged
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
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