Commit fc360e99 authored by Hans Wennborg's avatar Hans Wennborg Committed by Commit Bot

Fix DCHECK to actually check the strings are sorted

The previous DCHECK was comparing the pointer values, not the strings.

Bug: 833807
Change-Id: I0e63eda10838de481c51630f8932b41537a76847
Reviewed-on: https://chromium-review.googlesource.com/1013525
Commit-Queue: Hans Wennborg <hans@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551308}
parent 88d2fec8
......@@ -47,14 +47,15 @@ bool IsMicrosoftIme(const wchar_t* ime_guid) {
L"{fa445657-9379-11d6-b41a-00065b83ee53}",
};
constexpr auto comp = [](const wchar_t* lhs, const wchar_t* rhs) -> bool {
return base::CompareCaseInsensitiveASCII(lhs, rhs) == -1;
};
DCHECK(std::is_sorted(std::begin(kMicrosoftImeGuids),
std::end(kMicrosoftImeGuids)));
std::end(kMicrosoftImeGuids), comp));
return std::binary_search(
std::begin(kMicrosoftImeGuids), std::end(kMicrosoftImeGuids), ime_guid,
[](const wchar_t* lhs, const wchar_t* rhs) {
return base::CompareCaseInsensitiveASCII(lhs, rhs) == -1;
});
return std::binary_search(std::begin(kMicrosoftImeGuids),
std::end(kMicrosoftImeGuids), ime_guid, comp);
}
// Returns the path to the in-proc server DLL for |guid|, or an empty path if
......
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