<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Nice find.<div class=""><br class=""></div><div class="">The change LGTM, and is clearly what I always intended it to do.  I was confused how this ever worked at all, but I see that (at least in libc++) we move the values into place rather than swap them, so the values at the end are still the largest values for types with a trivial move constructor.</div><div class=""><br class=""></div><div class="">I am not working in this area these days and am not setup to provide a test case in any reasonable amount of time.  I think it would need a gtest, as I'm not sure this change is obvservable otherwise.</div><div class=""><br class=""></div><div class="">Ben<br class=""><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Nov 18, 2019, at 4:44 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hey Ben - if you're still involved with this part of the project - could you check that this change (to code you committed back in 2014, r215810) is correct & add a test case if possible?</div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 7, 2019 at 10:39 AM Reid Kleckner via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" class="">cfe-commits@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br class="">
Author: Reid Kleckner<br class="">
Date: 2019-11-07T10:39:29-08:00<br class="">
New Revision: dd870f6929ee0b1dfb5fd000c7b826a1bd2d2571<br class="">
<br class="">
URL: <a href="https://github.com/llvm/llvm-project/commit/dd870f6929ee0b1dfb5fd000c7b826a1bd2d2571" rel="noreferrer" target="_blank" class="">https://github.com/llvm/llvm-project/commit/dd870f6929ee0b1dfb5fd000c7b826a1bd2d2571</a><br class="">
DIFF: <a href="https://github.com/llvm/llvm-project/commit/dd870f6929ee0b1dfb5fd000c7b826a1bd2d2571.diff" rel="noreferrer" target="_blank" class="">https://github.com/llvm/llvm-project/commit/dd870f6929ee0b1dfb5fd000c7b826a1bd2d2571.diff</a><br class="">
<br class="">
LOG: Fix warning about unused std::unique result, erase shifted elements<br class="">
<br class="">
This is actually a functional change. I haven't added any new test<br class="">
coverage. I'm just trying to fix the warning and hoping for the best.<br class="">
<br class="">
Added: <br class="">
<br class="">
<br class="">
Modified: <br class="">
    clang/include/clang/Serialization/ContinuousRangeMap.h<br class="">
<br class="">
Removed: <br class="">
<br class="">
<br class="">
<br class="">
################################################################################<br class="">
diff  --git a/clang/include/clang/Serialization/ContinuousRangeMap.h b/clang/include/clang/Serialization/ContinuousRangeMap.h<br class="">
index 0c05537dd108..c2665c097416 100644<br class="">
--- a/clang/include/clang/Serialization/ContinuousRangeMap.h<br class="">
+++ b/clang/include/clang/Serialization/ContinuousRangeMap.h<br class="">
@@ -118,14 +118,17 @@ class ContinuousRangeMap {<br class="">
<br class="">
     ~Builder() {<br class="">
       llvm::sort(Self.Rep, Compare());<br class="">
-      std::unique(Self.Rep.begin(), Self.Rep.end(),<br class="">
-                  [](const_reference A, const_reference B) {<br class="">
-        // FIXME: we should not allow any duplicate keys, but there are a lot of<br class="">
-        // duplicate 0 -> 0 mappings to remove first.<br class="">
-        assert((A == B || A.first != B.first) &&<br class="">
-               "ContinuousRangeMap::Builder given non-unique keys");<br class="">
-        return A == B;<br class="">
-      });<br class="">
+      Self.Rep.erase(<br class="">
+          std::unique(<br class="">
+              Self.Rep.begin(), Self.Rep.end(),<br class="">
+              [](const_reference A, const_reference B) {<br class="">
+                // FIXME: we should not allow any duplicate keys, but there are<br class="">
+                // a lot of duplicate 0 -> 0 mappings to remove first.<br class="">
+                assert((A == B || A.first != B.first) &&<br class="">
+                       "ContinuousRangeMap::Builder given non-unique keys");<br class="">
+                return A == B;<br class="">
+              }),<br class="">
+          Self.Rep.end());<br class="">
     }<br class="">
<br class="">
     void insert(const value_type &Val) {<br class="">
<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
cfe-commits mailing list<br class="">
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank" class="">cfe-commits@lists.llvm.org</a><br class="">
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br class="">
</blockquote></div>
</div></blockquote></div><br class=""></div></div></body></html>