You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug, including details regarding any error messages, version, and platform.
In cpp/src/arrow/array/concatenate.cc , the const ArrayDataVector & in argument is referenced after being moved into the in_ within the member initializer list:
Using std::move on a constant lvalue reference might not causing a bug, because it might just copy the vector. But it's worthing to fix it.
Yes you're right, I'd forgotten that std::move instructs the compiler to try a move, but it's not guaranteed. This SO explains it well https://stackoverflow.com/a/28595207.
### Rationale for this change
Fixing style in `ConcatenateImpl::ConcatenateImpl`
### What changes are included in this PR?
1. Remove `std::move` on a const-ref
2. Use a foreach loop
### Are these changes tested?
Yes, by existing tests.
### Are there any user-facing changes?
No.
* Closes: #36446
Authored-by: mwish <maplewish117@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
Describe the bug, including details regarding any error messages, version, and platform.
In
cpp/src/arrow/array/concatenate.cc
, theconst ArrayDataVector & in
argument is referenced after being moved into thein_
within the member initializer list:arrow/cpp/src/arrow/array/concatenate.cc
Lines 172 to 191 in 7ebc88c
where
using ArrayDataVector = std::vector<std::shared_ptr<ArrayData>>;
intype_fwd.h
.I was surprised the code works and that this seems to result in a copy of
in
toin_
. But I suspect that eitherConcatenateImpl(ArrayDataVector in, MemoryPool* pool)
andin
should not be re-used after the move, or:in_(in), pool_(pool), out_(std::make_shared<ArrayData>())
Component(s)
C++
The text was updated successfully, but these errors were encountered: