MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / parallel_map_preserves_order

Function parallel_map_preserves_order

nodedb/src/engine/graph/olap/parallel.rs:299–312  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

297
298 #[test]
299 fn parallel_map_preserves_order() {
300 let snap = make_snapshot();
301 let config = ParallelConfig {
302 num_threads: 4,
303 min_partition_size: 10,
304 };
305
306 // Map node_id → node_id to verify ordering.
307 let ids: Vec<u32> = parallel_map(&snap, &config, |node, _| node);
308
309 for (i, &id) in ids.iter().enumerate() {
310 assert_eq!(id, i as u32, "order mismatch at index {i}");
311 }
312 }
313}

Callers

nothing calls this directly

Calls 3

make_snapshotFunction · 0.85
parallel_mapFunction · 0.85
iterMethod · 0.45

Tested by

no test coverage detected