MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/splashsurf / resize_and_fill

Function resize_and_fill

splashsurf_lib/src/utils.rs:69–80  ·  view source on GitHub ↗
(
    vec: &mut Vec<T>,
    new_len: usize,
    value: T,
    par: bool,
)

Source from the content-addressed store, hash-verified

67/// Resizes the given vector to the given length and fills new entries with `value.clone()`, parallel or sequential depending on runtime parameter
68#[allow(unused)]
69pub(crate) fn resize_and_fill<T: Clone + Send + Sync>(
70 vec: &mut Vec<T>,
71 new_len: usize,
72 value: T,
73 par: bool,
74) {
75 if par {
76 par_resize_and_fill(vec, new_len, value);
77 } else {
78 seq_resize_and_fill(vec, new_len, value);
79 }
80}
81
82/// Resizes the given vector to the given length and fills new entries with `value.clone()`, sequential version
83#[allow(unused)]

Callers

nothing calls this directly

Calls 2

par_resize_and_fillFunction · 0.85
seq_resize_and_fillFunction · 0.85

Tested by

no test coverage detected