-
Notifications
You must be signed in to change notification settings - Fork 179
Commit 02b7b68
CollectionItemElementSelector now returns a constant hashCode
The ElementSelector `hashCode` is only needed to use it as key in a
Map. With introduction of the `IdentityStrategy` this adds an
unnecessary source of confusion and complexity when implementing custom
IdentityStrategies.
To avoid this, returning a constant hashCode seems like a small price
to pay. Yes, it may have a small performance impact, but we can still
optimize when that turns out to be a problem.1 parent 678dbfd commit 02b7b68
File tree
3 files changed
+24
-7
lines changed- src
- main/java/de/danielbechler/diff/selector
- test/java/de/danielbechler/diff/selector
3 files changed
+24
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | + | ||
4 | + | ||
5 | + | ||
6 | + | ||
7 | + | ||
8 | + | ||
9 | + | ||
10 | + | ||
11 | + | ||
12 | + | ||
13 | + | ||
14 | + | ||
15 | + | ||
16 | + | ||
17 | + | ||
3 | 18 | | |
4 | 19 | | |
5 | 20 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | - | ||
74 | + | ||
75 | 75 | | |
76 | 76 | | |
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | - | ||
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | - | ||
41 | - | ||
42 | - | ||
43 | - | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | + | ||
43 | + | ||
44 | + | ||
45 | + | ||
44 | 46 | | |
45 | 47 | | |
46 | - | ||
48 | + | ||
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
0 commit comments