D19200: Return sorted definitions for file names and mime types

Dominik Haumann noreply at phabricator.kde.org
Thu Feb 21 22:32:27 GMT 2019


dhaumann added inline comments.

INLINE COMMENTS

> repository.cpp:83
>  {
> -    if (candidates.isEmpty())
> -        return Definition();
> -
> -    std::partial_sort(candidates.begin(), candidates.begin() + 1, candidates.end(), [](const Definition &lhs, const Definition &rhs) {
> +    std::partial_sort(definitions.begin(), definitions.begin() + 1, definitions.end(), [](const Definition &lhs, const Definition &rhs) {
>          return lhs.priority() > rhs.priority();

Isn't std::stable_sort what we want here?

REPOSITORY
  R216 Syntax Highlighting

REVISION DETAIL
  https://phabricator.kde.org/D19200

To: davschul, cullmann, vkrause
Cc: dhaumann, kwrite-devel, kde-frameworks-devel, bmortimer, michaelh, genethomas, ngraham, bruns, demsking, cullmann, vkrause, sars
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20190221/53a6d0ba/attachment-0001.html>


More information about the KWrite-Devel mailing list