File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121
2222#include < algorithm>
2323#include < map>
24+ #include < ranges>
2425#include < utility>
2526#include < vector>
2627
@@ -63,7 +64,7 @@ Result<std::vector<ManifestFile>> ManifestMergeManager::MergeManifests(
6364 // content types. Use reverse spec ordering to match Java's reverse-TreeMap behaviour,
6465 // which is observable in v3 tables where first-row IDs are assigned in output order.
6566 using GroupKey = std::pair<int32_t , ManifestContent>;
66- std::map<GroupKey, std::vector<ManifestFile>, std::greater<GroupKey >> by_spec;
67+ std::map<GroupKey, std::vector<ManifestFile>, std::greater<>> by_spec;
6768 for (const auto & m : all) {
6869 by_spec[{m.partition_spec_id , m.content }].push_back (m);
6970 }
@@ -97,8 +98,7 @@ Result<std::vector<ManifestFile>> ManifestMergeManager::MergeGroup(
9798 std::vector<ManifestFile> current_bin;
9899 int64_t bin_size = 0 ;
99100
100- for (auto it = group.rbegin (); it != group.rend (); ++it) {
101- const auto & manifest = *it;
101+ for (const auto & manifest : std::views::reverse (group)) {
102102 if (!current_bin.empty () &&
103103 bin_size + manifest.manifest_length > target_size_bytes_) {
104104 bins.push_back (std::move (current_bin));
You can’t perform that action at this time.
0 commit comments