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

Method remove

atomic-core/src/crdt/apply/order.rs:441–448  ·  view source on GitHub ↗

Removes an element by ID. Returns the removed element if found.

(&mut self, id: &Id)

Source from the content-addressed store, hash-verified

439 ///
440 /// Returns the removed element if found.
441 pub fn remove(&mut self, id: &Id) -> Option<Id> {
442 if let Some(idx) = self.position(id) {
443 self.after_refs.remove(idx);
444 Some(self.elements.remove(idx))
445 } else {
446 None
447 }
448 }
449
450 /// Clears all elements from the sequence.
451 #[inline]

Callers

nothing calls this directly

Calls 2

removeMethod · 0.65
positionMethod · 0.45

Tested by

no test coverage detected