Performance optimized button to button mask evaluation