MCPcopy Create free account
hub / github.com/iovisor/bcc / prepare_values_subset

Method prepare_values_subset

tests/python/test_map_batch_ops.py:43–54  ·  view source on GitHub ↗
(self, hmap, count=None)

Source from the content-addressed store, hash-verified

41 return keys
42
43 def prepare_values_subset(self, hmap, count=None):
44 if not count:
45 count = self.SUBSET_SIZE
46 values = (hmap.Leaf * count)()
47 i = 0
48 for _, v in sorted(hmap.items_lookup_batch(), key=lambda k:k[0].value):
49 if i < count:
50 values[i] = v.value * v.value
51 i += 1
52 else:
53 break
54 return values
55
56 def check_hashmap_values(self, it):
57 i = 0

Callers 1

Calls 1

items_lookup_batchMethod · 0.80

Tested by

no test coverage detected