MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / insertSorted

Function insertSorted

lib/web/CodeMirror/src/util/misc.js:104–108  ·  view source on GitHub ↗
(array, value, score)

Source from the content-addressed store, hash-verified

102}
103
104export function insertSorted(array, value, score) {
105 let pos = 0, priority = score(value)
106 while (pos < array.length && score(array[pos]) <= priority) pos++
107 array.splice(pos, 0, value)
108}
109
110function nothing() {}
111

Callers 1

methods.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected