MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / clone_set_items

Method clone_set_items

compiler/src/modules/vm/ops.rs:138–145  ·  view source on GitHub ↗

Clone the element set out of a `set` or `frozenset`; None for any other type. */

(&self, v: Val)

Source from the content-addressed store, hash-verified

136
137 /* Clone the element set out of a `set` or `frozenset`; None for any other type. */
138 pub(crate) fn clone_set_items(&self, v: Val) -> Option<ValSet> {
139 if !v.is_heap() { return None; }
140 match self.heap.get(v) {
141 HeapObj::Set(s) => Some(s.borrow().clone()),
142 HeapObj::FrozenSet(s) => Some((**s).clone()),
143 _ => None,
144 }
145 }
146
147 /* True for `set` or `frozenset` operands. */
148 pub(crate) fn is_set_like(&self, v: Val) -> bool {

Callers 3

set_binop_itemsMethod · 0.80
set_compare_and_pushMethod · 0.80
sub_valsMethod · 0.80

Calls 3

is_heapMethod · 0.80
borrowMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected