MCPcopy Index your code
hub / github.com/RustPython/RustPython / __const_concat_arrays

Method __const_concat_arrays

crates/vm/src/function/method.rs:229–252  ·  view source on GitHub ↗
(
        method_groups: &[&[Self]],
    )

Source from the content-addressed store, hash-verified

227
228 #[doc(hidden)]
229 pub const fn __const_concat_arrays<const SUM_LEN: usize>(
230 method_groups: &[&[Self]],
231 ) -> [Self; SUM_LEN] {
232 const NULL_METHOD: PyMethodDef = PyMethodDef {
233 name: "",
234 func: &|_, _| unreachable!(),
235 flags: PyMethodFlags::empty(),
236 doc: None,
237 };
238 let mut all_methods = [NULL_METHOD; SUM_LEN];
239 let mut all_idx = 0;
240 let mut group_idx = 0;
241 while group_idx < method_groups.len() {
242 let group = method_groups[group_idx];
243 let mut method_idx = 0;
244 while method_idx < group.len() {
245 all_methods[all_idx] = group[method_idx].const_copy();
246 method_idx += 1;
247 all_idx += 1;
248 }
249 group_idx += 1;
250 }
251 all_methods
252 }
253
254 const fn const_copy(&self) -> Self {
255 Self {

Callers

nothing calls this directly

Calls 2

const_copyMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected