Simplify chained comparisons

Change-Id: Ie4a840bf4b587c72ab9bdfb0ec539829fe380595
Merge "Simplify chained comparisons"