Skip to content

Commit

Permalink
return empty results for empty searchText
Browse files Browse the repository at this point in the history
  • Loading branch information
breandan committed Nov 30, 2019
1 parent 26a27e7 commit 3cae2d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/kotlin/org/acejump/search/Scanner.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ internal object Scanner {
fun findMatchingSites(searchText: String, model: AceFindModel, cache: Set<Int>) =
searchText.run {
val query = model.stringToFind
if (query.isEmpty()) return sortedSetOf<Int>()
if (searchText.isEmpty() || query.isEmpty()) return sortedSetOf<Int>()
// If the cache is populated, filter it instead of redoing prior work
if (cache.isEmpty()) findAll(model.toRegex(), boundaries.start)
else cache.asSequence().filter { index ->
Expand Down

0 comments on commit 3cae2d4

Please sign in to comment.