diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-03-13 14:22:06 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@qt.io> | 2017-03-14 05:29:27 +0000 |
commit | 2162f01111d21d0ce66ceb8be290b0a13653e691 (patch) | |
tree | 72e6222e3f86523130f249266cf86386b48fdcc6 /src/widgets/kernel/qaction.cpp | |
parent | c2c3452ba5b4c32d0c2d5df9193bf89986623ab5 (diff) |
Remove some redundant code in QAction
Only 2 bits are needed to represent -1, 0, and 1 in a signed integer,
and !(n != -1) implies n == -1 so the second condition was redundant.
Change-Id: I200a17fe4e49ebc0eaa9a1988b4625267cef61a4
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Diffstat (limited to 'src/widgets/kernel/qaction.cpp')
-rw-r--r-- | src/widgets/kernel/qaction.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp index ec7dc34d4d..130c354132 100644 --- a/src/widgets/kernel/qaction.cpp +++ b/src/widgets/kernel/qaction.cpp @@ -1278,8 +1278,7 @@ void QAction::setIconVisibleInMenu(bool visible) d->iconVisibleInMenu = visible; // Only send data changed if we really need to. if (oldValue != -1 - || (oldValue == -1 - && visible == !QApplication::instance()->testAttribute(Qt::AA_DontShowIconsInMenus))) { + || visible == !QApplication::instance()->testAttribute(Qt::AA_DontShowIconsInMenus)) { d->sendDataChanged(); } } |