]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
partitioned_set: use lower_bound(), not scan
authorJustin Viiret <justin.viiret@intel.com>
Wed, 16 Aug 2017 00:24:15 +0000 (10:24 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Mon, 18 Sep 2017 03:29:34 +0000 (13:29 +1000)
src/util/partitioned_set.h

index 313c08e1cf77bc6d66e3db542ccf6860985ca565..8a4d3dd9e1625297035ad523d0aedc983891016e 100644 (file)
@@ -128,12 +128,10 @@ public:
         }
 
         for (auto it = orig.members.begin(); it != orig.members.end(); ++it) {
-            member = *it;
+            const auto &member = *it;
             assert(member < member_to_subset.size());
 
-            while (sp_it != sp_e && *sp_it < member) {
-                ++sp_it;
-            }
+            sp_it = std::lower_bound(sp_it, sp_e, member);
             if (sp_it == sp_e) {
                 split_temp_diff.insert(split_temp_diff.end(), it,
                                        orig.members.end());