Commit 3a5bde61 authored by David Benjamin's avatar David Benjamin Committed by Commit Bot

Fix CalibrationPointPairCompare's comparison

This fixes a crash when building with _LIBCPP_DEBUG=0. The comparison
should also check pair_1.first.y() > pair_2.first.y() before moving on
to the x-coordinates.

gfx::Point already defines a comparision function which matches the one
here (compare y first, then x), so just use that.

Bug: 923166
Change-Id: Ie3eb7d76d4e6f0a1cbc56140059f260ce6313365
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1894101
Auto-Submit: David Benjamin <davidben@chromium.org>
Reviewed-by: default avatarMalay Keshav <malaykeshav@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711753}
parent 92241b7d
...@@ -249,9 +249,7 @@ std::string TouchDeviceIdentifier::SecondaryIdToString() const { ...@@ -249,9 +249,7 @@ std::string TouchDeviceIdentifier::SecondaryIdToString() const {
bool TouchCalibrationData::CalibrationPointPairCompare( bool TouchCalibrationData::CalibrationPointPairCompare(
const CalibrationPointPair& pair_1, const CalibrationPointPair& pair_1,
const CalibrationPointPair& pair_2) { const CalibrationPointPair& pair_2) {
return pair_1.first.y() < pair_2.first.y() return pair_1.first < pair_2.first;
? true
: pair_1.first.x() < pair_2.first.x();
} }
TouchCalibrationData::TouchCalibrationData() {} TouchCalibrationData::TouchCalibrationData() {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment