(array, value, score)
| 245 | } |
| 246 | |
| 247 | function insertSorted(array, value, score) { |
| 248 | var pos = 0, priority = score(value); |
| 249 | while (pos < array.length && score(array[pos]) <= priority) { pos++; } |
| 250 | array.splice(pos, 0, value); |
| 251 | } |
| 252 | |
| 253 | function nothing() {} |
| 254 |