From 7a7bff6d49cf772d183bc796dc6273d590e32cfb Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Mon, 6 Nov 2023 10:43:36 -0800 Subject: [PATCH] Update pkgs/cupertino_http/example/lib/main.dart Co-authored-by: Nate Bosch --- pkgs/cupertino_http/example/lib/main.dart | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkgs/cupertino_http/example/lib/main.dart b/pkgs/cupertino_http/example/lib/main.dart index 2a3017d200..bb48cf7009 100644 --- a/pkgs/cupertino_http/example/lib/main.dart +++ b/pkgs/cupertino_http/example/lib/main.dart @@ -73,13 +73,12 @@ class _HomePageState extends State { } final books = await _findMatchingBooks(query); - if (query == _lastQuery) { - // Avoid the situation where a slow-running query finishes late and - // replaces newer search results. - setState(() { - _books = books; - }); - } + // Avoid the situation where a slow-running query finishes late and + // replaces newer search results. + if (query == _lastQuery) return; + setState(() { + _books = books; + }); } @override