From bf72b63536ca898cdc015565d8eee5bc3c43aa50 Mon Sep 17 00:00:00 2001 From: fzyzcjy <5236035+fzyzcjy@users.noreply.github.com> Date: Fri, 7 Jul 2023 07:30:01 +0800 Subject: [PATCH] Super tiny code optimization: No need to redundantly check whether value has changed (#130050) Removed two unnecessary `if` conditions. --- packages/flutter/lib/src/widgets/text_selection.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/flutter/lib/src/widgets/text_selection.dart b/packages/flutter/lib/src/widgets/text_selection.dart index 34e32795519..a447e6e0cb9 100644 --- a/packages/flutter/lib/src/widgets/text_selection.dart +++ b/packages/flutter/lib/src/widgets/text_selection.dart @@ -3312,7 +3312,7 @@ class ClipboardStatusNotifier extends ValueNotifier with Widget )); // In the case of an error from the Clipboard API, set the value to // unknown so that it will try to update again later. - if (_disposed || value == ClipboardStatus.unknown) { + if (_disposed) { return; } value = ClipboardStatus.unknown; @@ -3322,7 +3322,7 @@ class ClipboardStatusNotifier extends ValueNotifier with Widget ? ClipboardStatus.pasteable : ClipboardStatus.notPasteable; - if (_disposed || nextStatus == value) { + if (_disposed) { return; } value = nextStatus;