Commit 8793a6d
committed
Fix libraries comparator logic
Previously it could lead to contract violations for example consider
this:
A = Library{ Name:"A", Types: ["Sensors"] }
B = Library{ Name:"B", Types: null }
C = Library{ Name:"C", Types: ["Arduino"] }
it results in:
A<B (because B has Types==null and compare("A","B")<0)
B<C (because B has Types==null and compare("B","C")<0)
C<A (becuase C has Types=="Arduino" and the comparator returns -1)
This commit fix this behavior1 parent 678420c commit 8793a6d
File tree
1 file changed
+7
-3
lines changed- app/src/cc/arduino/contributions/libraries/ui
1 file changed
+7
-3
lines changedLines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
50 | | - | |
51 | | - | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
| |||
0 commit comments