Skip to content

Commit 2ccc53d

Browse files
wgtmacCopilot
andauthored
Clarify comments on vector growth for copy-only types
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent cc2fdeb commit 2ccc53d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/iceberg/util/iterator.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ class Iterator {
9494
static_assert(std::is_copy_constructible_v<T>,
9595
"Iterator::ToVector requires T to be move- or copy-constructible");
9696

97-
// Growing a vector requires move-insertable elements in some standard library
98-
// implementations. Stage strictly copy-only values in a deque, then copy them
99-
// into an exactly sized vector.
97+
// For strictly copy-only T, collecting directly into a vector can repeatedly copy
98+
// previously collected elements during vector growth. Stage values in a deque,
99+
// then copy once into an exactly sized vector.
100100
std::deque<T> values;
101101
return collect(
102102
values, [](auto& destination, const T& value) { destination.push_back(value); },

0 commit comments

Comments
 (0)