MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / destroy_carefully

Method destroy_carefully

src/expr/src/relation.rs:1947–1954  ·  view source on GitHub ↗

Clears the contents of `self` even if it's so deep that simply dropping it would cause a stack overflow in `drop_in_place`. Leaves `self` in an unusable state, so this should only be used if `self` is about to be dropped or otherwise overwritten.

(&mut self)

Source from the content-addressed store, hash-verified

1945 /// Leaves `self` in an unusable state, so this should only be used if `self` is about to be
1946 /// dropped or otherwise overwritten.
1947 pub fn destroy_carefully(&mut self) {
1948 let mut todo = vec![self.take_dangerous()];
1949 while let Some(mut expr) = todo.pop() {
1950 for child in expr.children_mut() {
1951 todo.push(child.take_dangerous());
1952 }
1953 }
1954 }
1955
1956 /// Computes the size (total number of nodes) and maximum depth of a MirRelationExpr for
1957 /// debug printing purposes.

Callers 1

optimizeMethod · 0.80

Calls 4

take_dangerousMethod · 0.80
popMethod · 0.45
children_mutMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected