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

Method pop

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

* @zh 弹出最小元素 * @en Pop minimum element

()

Source from the content-addressed store, hash-verified

49 * @en Pop minimum element
50 */
51 pop(): T | undefined {
52 if (this.heap.length === 0) {
53 return undefined;
54 }
55
56 const result = this.heap[0];
57 const last = this.heap.pop()!;
58
59 if (this.heap.length > 0) {
60 this.heap[0] = last;
61 this.sinkDown(0);
62 }
63
64 return result;
65 }
66
67 /**
68 * @zh 查看最小元素(不移除)

Callers 15

findPolygonPathMethod · 0.95
inferAssetTypeFunction · 0.80
getFileActionHandlersMethod · 0.80
TexturePickerFunction · 0.80
ParticleEditorPanelFunction · 0.80
popClipRectMethod · 0.80
popClipRectMethod · 0.80
createTweenMethod · 0.80
getFileActionHandlersMethod · 0.80
getPreviewTilesMethod · 0.80
floodFillMethod · 0.80
isImageFileFunction · 0.80

Calls 1

sinkDownMethod · 0.95

Tested by 1

addComponentMethod · 0.64