File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1080,10 +1080,13 @@ bool ModelASTWalker::handleAttrRanges(ArrayRef<DeclAttributeAndRange> DeclRanges
1080
1080
1081
1081
SmallVector<DeclAttributeAndRange, 4 > SortedRanges (DeclRanges.begin (),
1082
1082
DeclRanges.end ());
1083
- std::sort (SortedRanges.begin (), SortedRanges.end (),
1084
- [&](DeclAttributeAndRange LHS, DeclAttributeAndRange RHS) {
1085
- return SM.isBeforeInBuffer (LHS.second .Start , RHS.second .End );
1086
- });
1083
+ std::sort (
1084
+ SortedRanges.begin (), SortedRanges.end (),
1085
+ [&](DeclAttributeAndRange LHS, DeclAttributeAndRange RHS) {
1086
+ // Since attributes don't overlap it's safe to compare just by the
1087
+ // range's Start
1088
+ return SM.isBeforeInBuffer (LHS.second .Start , RHS.second .Start );
1089
+ });
1087
1090
// Handle duplicate synthesized attributes due to * in @available
1088
1091
auto NewEnd = std::unique (SortedRanges.begin (), SortedRanges.end (),
1089
1092
[&](DeclAttributeAndRange LHS, DeclAttributeAndRange RHS) {
You can’t perform that action at this time.
0 commit comments