MCPcopy Create free account
hub / github.com/ReadyTalk/avian / remove

Method remove

classpath/java/util/TreeSet.java:188–212  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

186 }
187
188 public void remove() {
189 if (! canRemove) throw new IllegalStateException();
190
191 if (prevPrevCell != null && prevPrevCell.next == prevCell) {
192 // cell to remove is not the first in the list.
193 prevPrevCell.next = prevCell.next;
194 prevCell = prevPrevCell;
195 } else if (prevCell.next == cell && cell != null) {
196 // cell to remove is the first in the list, but not the last.
197 set = (PersistentSet) path.replaceWith(cell);
198 prevCell = null;
199 } else {
200 // cell is alone in the list.
201 set = (PersistentSet) path.remove();
202 path = nextPath;
203 if (path != null) {
204 prevCell = null;
205 cell = path.value();
206 path = (PersistentSet.Path) set.find((Cell) cell);
207 nextPath = nextPath();
208 }
209 }
210
211 canRemove = false;
212 }
213 }
214}

Callers

nothing calls this directly

Calls 5

nextPathMethod · 0.95
removeMethod · 0.65
findMethod · 0.65
replaceWithMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected