Commit 3fbfefb
committed
Replace
While this looked correct and we looked at this for the SDK 54 release
in September, we again found warnings when the patch versions mismatch,
and assume that when we reviewed this, we missed something.
Coming back to this and looking closer, the old code compared
`std::smatch` directly against each other from both searches. However,
`std::smatch` is an iterator, and, presumably, the comparison is
iterating all values and comparing them. The string at the zero-index,
like in JS, is a full match string. If that match string contains the
full `version` string, then the comparison can never succeed.
This means that this was always comparing exact version matches rather
than allowing patch versions to differ.
Instead, the new version matches two explicit groups on major and minor
versions for clarity, then compares index 1 and 2's (match 1 and 2's )
strings.matchVersion comparing full std::smatch structure1 parent fd07ac6 commit 3fbfefb
2 files changed
Lines changed: 10 additions & 38 deletions
File tree
- packages
- react-native-reanimated/Common/cpp/reanimated/Tools
- react-native-worklets/Common/cpp/worklets/Tools
Lines changed: 5 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
48 | 34 | | |
49 | 35 | | |
50 | 36 | | |
| |||
Lines changed: 5 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
32 | 18 | | |
33 | 19 | | |
34 | 20 | | |
| |||
0 commit comments