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 authored Oct 24, 2023
1 parent 69ecbd3 commit 5a82064
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 5a82064

Please sign in to comment.