Repository navigation
Commit 7517aa3
Do not key WeakHashMap by Integer
After JEP-401 that will throw IdentityException. Also, int-s outside of [-128;128) are not cached and boxing creates new instances, meaning that GC is free to reclaim them immediately.
getStyleFromString only returns 7 different values and the map stores pair of int-s: using LruCache-s is overkill and SparseArray is fine.
#60220
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory. -->
## Summary:
Do not key WeakHashMap by Integer as preparation for JEP-401
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->
## Changelog:
Do not key WeakHashMap by Integer as preparation for JEP-401.
Pick one each for the category and type tags:
[ANDROID][FIXED] -
Do not key WeakHashMap by Integer
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
## Test Plan:
<!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. -->
Differential Revision: D133975563
Pull Request resolved: #60223
(cherry picked from commit 375d0a9)1 parent 3cf0cfb commit 7517aa3
1 file changed
Lines changed: 12 additions & 8 deletions
File tree
- packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/progressbar
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
| 43 | + | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| |||
111 | 110 | | |
112 | 111 | | |
113 | 112 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
| |||
0 commit comments