Skip to content

Commit ff3edfe

Browse files
committed
fix: optimize
1 parent 0429d00 commit ff3edfe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/store/reducers/query/query.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,8 @@ const slice = createSlice({
199199
const currentRows = state.result.data.resultSets[resultIndex].result || [];
200200
let currentIndex = currentRows.length || 1;
201201

202-
// Process all rows at once instead of one by one
203-
const indexedRows = rows.map((row) => [currentIndex++, ...row]);
204202
const formattedRows = parseResult(
205-
indexedRows,
203+
rows,
206204
state.result.data.resultSets[resultIndex].columns,
207205
);
208206

@@ -212,6 +210,8 @@ const slice = createSlice({
212210
}
213211

214212
for (let i = 0; i < formattedRows.length; i++) {
213+
// get current here currentIndex
214+
formattedRows[i][INDEX_COLUMN.name] = currentIndex++;
215215
state.result.data.resultSets[resultIndex].result.push(formattedRows[i]);
216216
}
217217
}

0 commit comments

Comments
 (0)