Introduce singletone Locale to use identity hash maps#631
Introduce singletone Locale to use identity hash maps#631snuyanzin merged 2 commits intodatafaker-net:mainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #631 +/- ##
============================================
- Coverage 92.81% 92.56% -0.25%
- Complexity 2615 2618 +3
============================================
Files 280 281 +1
Lines 5371 5396 +25
Branches 587 589 +2
============================================
+ Hits 4985 4995 +10
- Misses 238 245 +7
- Partials 148 156 +8
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
But what is an FLocale? |
|
The problem with java's
Should be just internal class. Normally users should not use it... Only in some specific cases probably |
|
I'm not sure I follow. I don't think IdentityHashMap is using hashcode nor equals at all, it's using object references afaik. Still don't really see why it's called FLocale though. F stands for Singleton? |
Right now F stands for Faker. |
|
I'm not a big fan of abbreviations where I have to guess what it means, so perhaps SingletonLocale might be a name, or otherwise just a line of Javadoc could clear things up? |
|
makes sense |
|
I still don't really understand why there's a hashcode and and an equals in the SingletonLocale if you're only going to use it in an IdentityHashmap. Why did you need those? |
|
There are 2 cases
|
|
Ah, I missed that one. Thanks for taking the time to explain! |
|
no problem |
This could bring some perf improvements