From b48ae2ac424dd95826869523f98bfc74c87db288 Mon Sep 17 00:00:00 2001 From: Mariotaku Lee Date: Sun, 5 Mar 2017 00:35:14 +0800 Subject: [PATCH] fixed code warnings tweaking travis config --- .travis.yml | 2 +- .../org/mariotaku/twidere/activity/QuickSearchBarActivity.kt | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2e3211a94..9c09ca6e2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -73,7 +73,7 @@ before_script: - test -f twidere/src/google/AndroidManifest.xml script: - - ./gradlew clean build + - ./gradlew clean assembleGoogle after_failure: - travis/scripts/print_error_logs.sh diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/activity/QuickSearchBarActivity.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/activity/QuickSearchBarActivity.kt index bcf396205..2640d1a07 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/activity/QuickSearchBarActivity.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/activity/QuickSearchBarActivity.kt @@ -370,13 +370,11 @@ class QuickSearchBarActivity : BaseActivity(), OnClickListener, LoaderCallbacks< } override fun swapCursor(newCursor: Cursor?): Cursor? { - indices = if (newCursor != null) SuggestionItem.Indices(newCursor) else null - removedPositions!!.clear() + indices = newCursor?.let(SuggestionItem::Indices) return super.swapCursor(newCursor) } override fun getCount(): Int { - if (removedPositions == null) return super.getCount() return super.getCount() - removedPositions.size() }