From 3a87deed2a09eb1cb37bdf50ee383fcc288fee96 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 10 Jul 2014 16:35:36 +0000 Subject: [PATCH] Use XOR operation to toggle the state of check box in wxPG. Minor optimization by using single XOR operation instead of separate AND, OR operations to toggle the state of wxSimpleCheckBox. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76886 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/editors.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index 0ce51e1ef1..918e4722ed 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -1571,10 +1571,7 @@ void wxSimpleCheckBox::SetValue( int value ) { if ( value == wxSCB_SETVALUE_CYCLE ) { - if ( m_state & wxSCB_STATE_CHECKED ) - m_state &= ~wxSCB_STATE_CHECKED; - else - m_state |= wxSCB_STATE_CHECKED; + m_state ^= wxSCB_STATE_CHECKED; } else {