mirror of
https://github.com/morluto/rea.git
synced 2026-12-05 06:21:12 +00:00
perf(views/js): route indexed views through selectIndexedViewRows and avoid iterableReferences copy (#13775)
This commit is contained in:
1 parent
4a62303717
commit
819d046e60
6 files changed
+100
-82
No files matched your search
@@ -17,7 +17,7 @@ import {
|
||||
completeWithinViewCoverage,
|
||||
pageViewCoverage,
|
||||
} from "./analysisViewCoverage.js";
|
||||
import { selectViewRows } from "./selectViewRows.js";
|
||||
import { selectIndexedViewRows, selectViewRows } from "./selectViewRows.js";
|
||||
|
||||
const code = pythonPycSchema.shape.code_objects.element;
|
||||
|
||||
@@ -110,6 +110,8 @@ export const projectPythonPycView = (
|
||||
),
|
||||
source_index,
|
||||
});
|
||||
const matches = (row: PythonPycCodeObject) =>
|
||||
names === undefined || names.has(row.name);
|
||||
const selected =
|
||||
names === undefined && indices === undefined
|
||||
? {
|
||||
@@ -118,14 +120,15 @@ export const projectPythonPycView = (
|
||||
.map((row, index) => projectRow(row, view.offset + index)),
|
||||
total: code_objects.length,
|
||||
}
|
||||
: selectViewRows(
|
||||
code_objects,
|
||||
view,
|
||||
(row, index) =>
|
||||
(names === undefined || names.has(row.name)) &&
|
||||
(indices === undefined || indices.has(index)),
|
||||
projectRow,
|
||||
);
|
||||
: indices !== undefined
|
||||
? selectIndexedViewRows(
|
||||
code_objects,
|
||||
indices,
|
||||
view,
|
||||
matches,
|
||||
projectRow,
|
||||
)
|
||||
: selectViewRows(code_objects, view, matches, projectRow);
|
||||
return ok({
|
||||
...shared,
|
||||
kind: "python-pyc" as const,
|
||||
|
||||
Reference in new issue
Block a user