Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(592)

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/FilePathScoreFunction.js

Issue 2584113002: DevTools: render progress while picking the go-to-file. (Closed)
Patch Set: rebaselined Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/sources/FilePathScoreFunction.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/FilePathScoreFunction.js b/third_party/WebKit/Source/devtools/front_end/sources/FilePathScoreFunction.js
index 845d6d2697ec0e3abdc3c1ff851350e36f5cbc07..7d674651259e94bc0c3a514f0b866ecb7ddb7b9a 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/FilePathScoreFunction.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/FilePathScoreFunction.js
@@ -38,8 +38,8 @@ Sources.FilePathScoreFunction = class {
constructor(query) {
this._query = query;
this._queryUpperCase = query.toUpperCase();
- this._score = null;
- this._sequence = null;
+ this._score = new Int32Array(20 * 100);
+ this._sequence = new Int32Array(20 * 100);
this._dataUpperCase = '';
this._fileNameIndex = 0;
}
@@ -79,7 +79,8 @@ Sources.FilePathScoreFunction = class {
}
if (matchIndexes)
this._restoreMatchIndexes(sequence, n, m, matchIndexes);
- return score[n * m - 1];
+ const maxDataLength = 256;
+ return score[n * m - 1] * maxDataLength + (maxDataLength - data.length);
}
/**

Powered by Google App Engine
This is Rietveld 408576698