search: remove redundant check

We check for (metasNeeded.length == 0) at the beginning of the function,
which is only ever called when when a non-zero number of results is
received back from the provider. Effectively, this means that
(metas.length != metasNeeded.length) will also catch (metas.length == 0)
and print a nicer message to the log.
This commit is contained in:
Cosimo Cecchi 2015-01-07 18:16:04 +08:00 committed by Jasper St. Pierre
parent 67a807e849
commit 8345fe006e

View File

@ -199,10 +199,6 @@ const SearchResultsBase = new Lang.Class({
this._cancellable.reset();
this.provider.getResultMetas(metasNeeded, Lang.bind(this, function(metas) {
if (metas.length == 0) {
callback(false);
return;
}
if (metas.length != metasNeeded.length) {
log('Wrong number of result metas returned by search provider ' + this.provider.id +
': expected ' + metasNeeded.length + ' but got ' + metas.length);