MCPcopy Create free account
hub / github.com/esengine/esengine / update

Method update

packages/pathfinding/src/core/BinaryHeap.ts:79–85  ·  view source on GitHub ↗

* @zh 更新元素(重新排序) * @en Update element (re-sort)

(item: T)

Source from the content-addressed store, hash-verified

77 * @en Update element (re-sort)
78 */
79 update(item: T): void {
80 const index = this.heap.indexOf(item);
81 if (index !== -1) {
82 this.bubbleUp(index);
83 this.sinkDown(index);
84 }
85 }
86
87 /**
88 * @zh 检查是否包含元素

Callers 1

findPolygonPathMethod · 0.95

Calls 2

bubbleUpMethod · 0.95
sinkDownMethod · 0.95

Tested by

no test coverage detected