searchDisplay: don't create useless SearchResult's

average constructing time for 1 SearchResult is 3 ms.
It give > 400 result on query like 'a' (on my machine).
https://bugzilla.gnome.org/show_bug.cgi?id=645313
This commit is contained in:
Maxim Ermilov
2011-03-22 01:53:07 +03:00
parent 9ef4cc0ab9
commit 12bd374477
2 changed files with 33 additions and 6 deletions

View File

@ -281,6 +281,10 @@ IconGrid.prototype = {
}
},
childrenInRow: function(rowWidth) {
return this._computeLayout(rowWidth)[0];
},
_computeLayout: function (forWidth) {
let nColumns = 0;
let usedWidth = 0;