refactor(C++): change FilterOptions parameter to be moved instead of const reference#891
refactor(C++): change FilterOptions parameter to be moved instead of const reference#891SYaoJun wants to merge 3 commits intoapache:mainfrom
Conversation
…const reference Signed-off-by: syaojun <libevent@yeah.net>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #891 +/- ##
============================================
+ Coverage 79.81% 80.60% +0.78%
Complexity 615 615
============================================
Files 93 94 +1
Lines 10296 10709 +413
Branches 1055 1055
============================================
+ Hits 8218 8632 +414
+ Misses 1838 1837 -1
Partials 240 240
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR refactors several C++ constructors to take parameters by value and std::move them into members, aiming to reduce unnecessary copies (notably for util::FilterOptions and some std::string prefixes).
Changes:
- Update
PropertyGroup/AdjacentListconstructors to takeprefixby value and move into members. - Update
VertexPropertyArrowChunkReader/AdjListPropertyArrowChunkReaderconstructors to takeutil::FilterOptionsby value and move into members. - Update internal
VertexInfo::Impl/EdgeInfo::Implconstructors to take somestd::stringfields by value and move into members.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| cpp/src/graphar/graph_info.h | Public API ctor signatures updated to pass prefix by value. |
| cpp/src/graphar/graph_info.cc | Moves prefix/type strings into members; internal ctor signatures adjusted. |
| cpp/src/graphar/arrow/chunk_reader.h | Public ctor signatures updated to pass FilterOptions by value; one ctor still takes prefix by-value-const. |
| cpp/src/graphar/arrow/chunk_reader.cc | Implementations updated to move FilterOptions into members. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jason Yao <libevent@yeah.net>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Jason Yao <libevent@yeah.net>
Reason for this PR
use std::move instead of const refernce
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?