Simplified cmpValues()

Simplified cmpValues() with ternary operator.