Skip to content

Commit f5c24f6

Browse files
committed
Improve sort
1 parent 6fdaf4c commit f5c24f6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎denops/ddu/ddu.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1257,7 +1257,9 @@ export class Ddu {
12571257
},
12581258
): Promise<void> {
12591259
const { preventRedraw, signal = this.#aborter.signal } = opts ?? {};
1260-
for (const item of items.sort((a, b) => a.item.__level - b.item.__level)) {
1260+
for (
1261+
const item of [...items].sort((a, b) => a.item.__level - b.item.__level)
1262+
) {
12611263
const maxLevel = item.maxLevel && item.maxLevel < 0
12621264
? -1
12631265
: item.item.__level + (item.maxLevel ?? 0);

0 commit comments

Comments
 (0)