-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BAU — Make some US/Canada postcode mapping constants static
Make some constants in the code that maps US ZIP codes to states and Canadian postal codes to provinces or territories static, so they’re only created once in the lifetime of the application. The affected constants are all either regex patterns, unmodifiable maps or strings, which are all immutable and thread-safe, so making them static is safe. Otherwise, each constant is created each time the class it’s in is instantiated, which for some payment gateways can happen every time an authorisation request is sent, even if the payment does not have a US or Canadian address.
- Loading branch information
1 parent
0bc1fed
commit abf7ba3
Showing
3 changed files
with
22 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters