From b1b60d53e70d2d6ae4efeebb926d6abcd18525ba Mon Sep 17 00:00:00 2001 From: fuho Date: Thu, 22 Dec 2016 23:15:22 -0500 Subject: [PATCH] Update Completions.kt Minor language change --- src/main/java/typeahead/Completions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/typeahead/Completions.kt b/src/main/java/typeahead/Completions.kt index 4c30c18..b28aeaf 100644 --- a/src/main/java/typeahead/Completions.kt +++ b/src/main/java/typeahead/Completions.kt @@ -26,7 +26,7 @@ fun NavigableSet.complete(input: String): List { // ] val canonicalisedInput = input.toLowerCase() - val seq = sequenceOf(canonicalisedInput.lastIndex + 1 downTo 0).map { + val seq = (canonicalisedInput.lastIndex + 1 downTo 0).asSequence().map { canonicalisedInput.substring(0, it) to canonicalisedInput.substring(it) } fun NavigableSet.query(s: String) = tailSet(NGram(s)).headSet(NGram(s + Char.MAX_SURROGATE))