Commit 7d4364e
committed
get_contents: use list instead of set for the partitions
Running get_contents multiple times with the same input files generate
different output files. This is because the list of partitions from
partitions.xml are parsed and stored in a set data structure, which is
unsorted. Looping on the set will return different output.
Convert the set into a list instead which leads to:
1. the output is sorted, and thus the generated file is stable
2. the order from partitions.xml is preserved
While making this change, I decided to put dict elements in the list
instead of a list, it's easier to refer to field by name than by
index.
Signed-off-by: Nicolas Dechesne <[email protected]>1 parent fc12ab8 commit 7d4364e
1 file changed
+7
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
| 40 | + | |
| 41 | + | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
46 | | - | |
47 | | - | |
| 45 | + | |
| 46 | + | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
| |||
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
59 | | - | |
| 58 | + | |
60 | 59 | | |
61 | | - | |
| 60 | + | |
62 | 61 | | |
63 | | - | |
| 62 | + | |
64 | 63 | | |
65 | 64 | | |
66 | 65 | | |
| |||
0 commit comments