Note this is O(N*M), but in practice this doesn't matter because kernel cmdlines are typically quite small (limited to at most 4k depending on arch). Using a hash-based structure to reduce this to O(N)+C would likely raise the C portion so much as to erase any benefit from removing the combinatorial complexity. Plus CPUs are good at caching/pipelining through contiguous memory.
(&mut self, iter: T)
| 258 | // combinatorial complexity. Plus CPUs are good at |
| 259 | // caching/pipelining through contiguous memory. |
| 260 | fn extend<T: IntoIterator<Item = Parameter<'other>>>(&mut self, iter: T) { |
| 261 | for param in iter { |
| 262 | self.add(¶m); |
| 263 | } |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | /// A single kernel command line parameter key |