Make getConstraint() a tiny bit more readable.
Merge pull request #2457 from bar/2.5-getconstraint

Make getConstraint() a tiny bit more readable.