Skip to content

Commit bf72b63

Browse files
authored
Super tiny code optimization: No need to redundantly check whether value has changed (#130050)
Removed two unnecessary `if` conditions.
1 parent 1fb3687 commit bf72b63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/flutter/lib/src/widgets/text_selection.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3312,7 +3312,7 @@ class ClipboardStatusNotifier extends ValueNotifier<ClipboardStatus> with Widget
33123312
));
33133313
// In the case of an error from the Clipboard API, set the value to
33143314
// unknown so that it will try to update again later.
3315-
if (_disposed || value == ClipboardStatus.unknown) {
3315+
if (_disposed) {
33163316
return;
33173317
}
33183318
value = ClipboardStatus.unknown;
@@ -3322,7 +3322,7 @@ class ClipboardStatusNotifier extends ValueNotifier<ClipboardStatus> with Widget
33223322
? ClipboardStatus.pasteable
33233323
: ClipboardStatus.notPasteable;
33243324

3325-
if (_disposed || nextStatus == value) {
3325+
if (_disposed) {
33263326
return;
33273327
}
33283328
value = nextStatus;

0 commit comments

Comments
 (0)