MCPcopy Create free account
hub / github.com/bootc-dev/bootc / extend

Method extend

crates/kernel_cmdline/src/bytes.rs:364–375  ·  view source on GitHub ↗
(&mut self, iter: T)

Source from the content-addressed store, hash-verified

362
363impl<'a, 'other> Extend<Parameter<'other>> for Cmdline<'a> {
364 fn extend<T: IntoIterator<Item = Parameter<'other>>>(&mut self, iter: T) {
365 // Note this is O(N*M), but in practice this doesn't matter
366 // because kernel cmdlines are typically quite small (limited
367 // to at most 4k depending on arch). Using a hash-based
368 // structure to reduce this to O(N)+C would likely raise the C
369 // portion so much as to erase any benefit from removing the
370 // combinatorial complexity. Plus CPUs are good at
371 // caching/pipelining through contiguous memory.
372 for param in iter {
373 self.add(&param);
374 }
375 }
376}
377
378impl PartialEq for Cmdline<'_> {

Callers 2

test_extendFunction · 0.45
test_extend_emptyFunction · 0.45

Calls 1

addMethod · 0.45

Tested by 2

test_extendFunction · 0.36
test_extend_emptyFunction · 0.36