From ff6b0043c4e214d28c541358505accb4a78688c3 Mon Sep 17 00:00:00 2001 From: Anton Kastritskiy Date: Tue, 30 May 2023 08:01:18 -0700 Subject: [PATCH] avoid creating a copy of an array of entire view to look up index Summary: What title says Reviewed By: lblasa Differential Revision: D46275672 fbshipit-source-id: 65c6566a042b576b83ababdf6470ddf2f626d3e4 --- desktop/flipper-plugin-core/src/data-source/DataSource.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/flipper-plugin-core/src/data-source/DataSource.tsx b/desktop/flipper-plugin-core/src/data-source/DataSource.tsx index d3161f32e..bc722c079 100644 --- a/desktop/flipper-plugin-core/src/data-source/DataSource.tsx +++ b/desktop/flipper-plugin-core/src/data-source/DataSource.tsx @@ -585,7 +585,7 @@ export class DataSourceView { } getViewIndex(entry: T): number { - return this.output(0, Infinity).indexOf(entry); + return this._output.findIndex((x) => x.value === entry); } public setWindow(start: number, end: number) {