Commit 97af758b authored by David Benjamin's avatar David Benjamin Committed by Commit Bot

Fix ScoreTabsWithPairwiseScorer's comparator

This fixes a crash when building with _LIBCPP_DEBUG=0. This function
returned true for nullopt < nullopt when it should return false.

Bug: 923166
Change-Id: I904566ad19ca4ac6e1405db15851ffa79b3a4836
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1894099
Auto-Submit: David Benjamin <davidben@chromium.org>
Commit-Queue: Charles . <charleszhao@chromium.org>
Reviewed-by: default avatarCharles . <charleszhao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711530}
parent 687ed116
...@@ -234,10 +234,10 @@ std::map<int32_t, float> TabScorePredictor::ScoreTabsWithPairwiseScorer( ...@@ -234,10 +234,10 @@ std::map<int32_t, float> TabScorePredictor::ScoreTabsWithPairwiseScorer(
[&tabs](const int32_t id1, const int32_t id2) { [&tabs](const int32_t id1, const int32_t id2) {
const auto& tab1 = tabs.at(id1); const auto& tab1 = tabs.at(id1);
const auto& tab2 = tabs.at(id2); const auto& tab2 = tabs.at(id2);
if (!tab1)
return true;
if (!tab2) if (!tab2)
return false; return false;
if (!tab1)
return true;
return tab1->mru_index < tab2->mru_index; return tab1->mru_index < tab2->mru_index;
}); });
......
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