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

Commit

Permalink
Fix #8261: performance issue of BraveCertificateUtils.formatDate(_:)
Browse files Browse the repository at this point in the history
  • Loading branch information
thai-d-v committed Oct 17, 2023
1 parent cdd4078 commit 2b1d01f
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 2b1d01f

Please sign in to comment.