if (valid) validation in line 266 seems unnecessary.
valid is initialized as true in line 255 and is still unchanged when line 266 is reached.
Remove unnecessary validation #561
pull w0xlt wants to merge 1 commits into bitcoin-core:master from w0xlt:remove_unnecessary_validation changing 1 files +1 −1-
w0xlt commented at 1:40 AM on March 1, 2022: contributor
-
gui: remove unnecessary validation e4cc7b3949
-
in src/qt/sendcoinsdialog.cpp:266 in e4cc7b3949
262 | @@ -263,7 +263,7 @@ bool SendCoinsDialog::PrepareSendText(QString& question_string, QString& informa 263 | { 264 | recipients.append(entry->getValue()); 265 | } 266 | - else if (valid) 267 | + else
laanwj commented at 8:49 AM on March 1, 2022:The
if (valid)makes sure thatensureWidgetVisibleis only called once, even if there are invalid entries.I'm not sure if this is important, either for performance or correctness, but it's something to consider.Edit: I think I understand it now: the idea is to call
ensureWidgetVisibleon the first invalid entry. Not every one, or the last one.laanwj commented at 8:50 AM on March 1, 2022: memberSlight NACK on this change, the change does subtly change behavior, and seems unnecessary.
w0xlt closed this on Mar 2, 2022bitcoin-core locked this on Mar 2, 2023
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-27 03:20 UTC
This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-27 03:20 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me