mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Super tiny code optimization: No need to redundantly check whether value has changed (#130050)
Removed two unnecessary `if` conditions.
This commit is contained in:
parent
1fb3687bf8
commit
bf72b63536
@ -3312,7 +3312,7 @@ class ClipboardStatusNotifier extends ValueNotifier<ClipboardStatus> 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<ClipboardStatus> with Widget
|
||||
? ClipboardStatus.pasteable
|
||||
: ClipboardStatus.notPasteable;
|
||||
|
||||
if (_disposed || nextStatus == value) {
|
||||
if (_disposed) {
|
||||
return;
|
||||
}
|
||||
value = nextStatus;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user