MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / insertNode

Function insertNode

libs/mapv/mapv.js:2149–2162  ·  view source on GitHub ↗
(i, x, y, last)

Source from the content-addressed store, hash-verified

2147
2148// create a node and optionally link it with previous one (in a circular doubly linked list)
2149function insertNode(i, x, y, last) {
2150 var p = new Node(i, x, y);
2151
2152 if (!last) {
2153 p.prev = p;
2154 p.next = p;
2155 } else {
2156 p.next = last.next;
2157 p.prev = last;
2158 last.next.prev = p;
2159 last.next = p;
2160 }
2161 return p;
2162}
2163
2164function removeNode(p) {
2165 p.next.prev = p.prev;

Callers 1

linkedListFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected