Commit 43f3765c702a25773717997c0eb377f228deca32
early return!
mix irving committed on 9/20/2017, 5:58:09 AMParent: 4edb6b6bff53475c9709f189f23c7eaf7c1674dd
Files changed
channel/async/suggest.js | changed |
channel/async/suggest.js | ||
---|---|---|
@@ -15,19 +15,19 @@ | ||
15 | 15 … | var suggestions = null |
16 | 16 … | var subscribed = null |
17 | 17 … | |
18 | 18 … | return nest('channel.async.suggest', suggestedChannels) |
19 | - | |
19 … | + | |
20 | 20 … | function suggestedChannels () { |
21 | 21 … | loadSuggestions() |
22 | 22 … | return function (word) { |
23 | 23 … | if (!word) { |
24 | 24 … | return suggestions().slice(0, 100) |
25 | - } else { | |
26 | - word = word.toLowerCase() | |
27 | - return suggestions() | |
28 | - .filter(item => ~item.title.toLowerCase().indexOf(word)) | |
29 | 25 … | } |
26 … | + | |
27 … | + word = word.toLowerCase() | |
28 … | + return suggestions() | |
29 … | + .filter(item => ~item.title.toLowerCase().indexOf(word)) | |
30 | 30 … | } |
31 | 31 … | } |
32 | 32 … | |
33 | 33 … | function loadSuggestions () { |
Built with git-ssb-web