MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / add_pending

Method add_pending

atomic-core/src/record/workflow/graph_op/builder.rs:257–268  ·  view source on GitHub ↗

Add a pending change, potentially combining with existing ones.

(&mut self, change: PendingChange)

Source from the content-addressed store, hash-verified

255
256 /// Add a pending change, potentially combining with existing ones.
257 fn add_pending(&mut self, change: PendingChange) {
258 // Check if we can combine with the last pending change
259 if let Some(last) = self.pending.last() {
260 if last.can_combine_with(&change, self.options.combine_threshold) {
261 let combined = last.combine_with(&change);
262 self.pending.pop();
263 self.pending.push(combined);
264 return;
265 }
266 }
267 self.pending.push(change);
268 }
269
270 /// Finish building and return the result.
271 ///

Callers 3

process_insertMethod · 0.80
process_deleteMethod · 0.80

Calls 4

lastMethod · 0.80
can_combine_withMethod · 0.80
combine_withMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected