-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-35437: [C++] Remove obsolete TODO about DictionaryArray const& return types #48956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
| const auto& dict_array = checked_cast<const DictionaryArray&>(array); | ||
| // TODO: These methods should probably return a const&? They seem capable. | ||
| // https://github.com/apache/arrow/issues/35437 | ||
| auto dict_values = dict_array.dictionary(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably can be const auto but let me don't mix it with the current issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just make them both const auto&?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
pitrou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, just a small suggestion.
| const auto& dict_array = checked_cast<const DictionaryArray&>(array); | ||
| // TODO: These methods should probably return a const&? They seem capable. | ||
| // https://github.com/apache/arrow/issues/35437 | ||
| auto dict_values = dict_array.dictionary(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just make them both const auto&?
Rationale for this change
The TODO comment in
vector_array_sort.ccasking whetherDictionaryArray::dictionary()andDictionaryArray::indices()should returnconst&has been obsolete.It was added in commit 6ceb12f when dictionary array sorting was implemented. At that time, these methods returned
std::shared_ptr<Array>by value, causing unnecessary copies.The issue was fixed in commit 95a8bfb which changed both methods to return
const std::shared_ptr<Array>&, removing the copies. However, the TODO comment was left unremoved.What changes are included in this PR?
Removed the outdated TODO comment that referenced GH-35437.
Are these changes tested?
I did not test.
Are there any user-facing changes?
No.