From ce0c857e453cf743091ad6f8c4143cf68cfbbdd2 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Fri, 7 May 2021 16:16:24 -0700 Subject: [PATCH] Avoid rebind if data didn't change Bug: 187531176 Test: Manual Change-Id: I94ab7ecfbed0cb8f0fbae995b4e2ff9c9cdaa808 --- src/com/android/launcher3/allapps/AlphabeticalAppsList.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java index 6957850730..88d95faea7 100644 --- a/src/com/android/launcher3/allapps/AlphabeticalAppsList.java +++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java @@ -30,6 +30,7 @@ import java.util.Collections; import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Objects; import java.util.TreeMap; /** @@ -181,11 +182,10 @@ public class AlphabeticalAppsList implements AllAppsStore.OnUpdateListener { * Sets results list for search */ public boolean setSearchResults(ArrayList results) { - if (results == null || mSearchResults != results) { - boolean same = mSearchResults != null && mSearchResults.equals(results); + if (!Objects.equals(results, mSearchResults)) { mSearchResults = results; updateAdapterItems(); - return !same; + return true; } return false; }