compact is better

This commit is contained in:
Sam 2013-06-12 15:47:58 +10:00
parent d5b07464ea
commit 165751e71b
2 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ Discourse.SearchController = Em.ArrayController.extend(Discourse.Presence, {
.map(function(n){ .map(function(n){
return _(results).where({type: n}).first() return _(results).where({type: n}).first()
}) })
.without(undefined) .compact()
.each(function(list){ .each(function(list){
_.each(list.results, function(item){ _.each(list.results, function(item){
item.index = index++; item.index = index++;

View File

@ -91,7 +91,7 @@ Discourse.TopicList.reopenClass({
.map(function(id){ .map(function(id){
return newTopics.find(function(t){ return t.id === id; }); return newTopics.find(function(t){ return t.id === id; });
}) })
.without(undefined) .compact()
.value(); .value();
defer.resolve(topics); defer.resolve(topics);