diff options
Diffstat (limited to 'clang-tools-extra/clang-doc/Representation.h')
| -rw-r--r-- | clang-tools-extra/clang-doc/Representation.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clang-tools-extra/clang-doc/Representation.h b/clang-tools-extra/clang-doc/Representation.h index c1f3fd484d9..a142bba8827 100644 --- a/clang-tools-extra/clang-doc/Representation.h +++ b/clang-tools-extra/clang-doc/Representation.h @@ -75,15 +75,16 @@ struct CommentInfo { Other.ParamName, Other.CloseName, Other.SelfClosing, Other.Explicit, Other.AttrKeys, Other.AttrValues, Other.Args); - if (FirstCI < SecondCI || - (FirstCI == SecondCI && Children.size() < Other.Children.size())) + if (FirstCI < SecondCI) return true; - if (FirstCI > SecondCI || Children.size() > Other.Children.size()) - return false; + if (FirstCI == SecondCI) { + return std::lexicographical_compare( + Children.begin(), Children.end(), Other.Children.begin(), + Other.Children.end(), llvm::deref<llvm::less>()); + } - return std::equal(Children.begin(), Children.end(), Other.Children.begin(), - llvm::deref<llvm::less>{}); + return false; } SmallString<16> |

