Commit 8f2ab7f
committed
Simplify
`SwitchSources` is a hashmap containing `SmallVec<[Option<u128>; 1]>`
elements. Each `SmallVec` has a predictable form: N `Some` elements
followed by a single `None` element.
This commit removes the trailing `None` element, changes the
`Option<u128>` to `u128`, and adjusts the single `switch_sources`
callsite to account for this (by adding a single unrolled loop iteration
for the elided `None` element, which simplifies down to a single
`propagate` call).SwitchSources.1 parent be137a2 commit 8f2ab7f
File tree
2 files changed
+7
-9
lines changed- compiler
- rustc_middle/src/mir
- rustc_mir_dataflow/src/framework
2 files changed
+7
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
85 | | - | |
| 86 | + | |
86 | 87 | | |
87 | | - | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 118 | + | |
| 119 | + | |
123 | 120 | | |
124 | 121 | | |
| 122 | + | |
125 | 123 | | |
126 | 124 | | |
127 | 125 | | |
| |||
0 commit comments