Fix order of operations in tilde comparison

The previous form of the statement evaluated to a constant comparison
and couldn't have been what was actually intended.
This commit is contained in:
Mahmoud Al-Qudsi 2019-05-09 01:22:23 -05:00
parent 4c0a119557
commit 097d6c3c5b

View file

@ -245,7 +245,7 @@ static bool compare_completions_by_duplicate_arguments(const completion_t &a,
} }
static bool compare_completions_by_tilde(const completion_t &a, const completion_t &b) { static bool compare_completions_by_tilde(const completion_t &a, const completion_t &b) {
return a.completion.back() == L'~' < b.completion.back() == L'~'; return (a.completion.back() == L'~') < (b.completion.back() == L'~');
} }
/// Unique the list of completions, without perturbing their order. /// Unique the list of completions, without perturbing their order.
static void unique_completions_retaining_order(std::vector<completion_t> *comps) { static void unique_completions_retaining_order(std::vector<completion_t> *comps) {