-
Notifications
You must be signed in to change notification settings - Fork 20
Add mutability binary view #526
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?
Add mutability binary view #526
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #526 +/- ##
==========================================
- Coverage 88.11% 88.07% -0.04%
==========================================
Files 100 100
Lines 7470 7639 +169
==========================================
+ Hits 6582 6728 +146
- Misses 888 911 +23
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:
|
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
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.
Pull Request Overview
This PR adds mutation support to the variable size binary view array implementation, enabling resize, insert, and erase operations. The implementation provides comprehensive mutating functionality while managing the complex storage layout of binary view arrays with their inline storage optimization for strings ≤12 bytes.
Key changes:
- Adds assignment, resize, insert, and erase methods to the binary view array
- Implements comprehensive test coverage for all mutation operations
- Fixes assertion logic in the base class to allow empty range operations
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
include/sparrow/variable_size_binary_view_array.hpp |
Adds mutating methods (assign, resize_values, insert_value, insert_values, erase_values) with complex buffer management logic |
include/sparrow/layout/mutable_array_base.hpp |
Fixes assertion to allow empty range erases (first == last) |
test/test_variable_size_binary_view_array.cpp |
Comprehensive test suite covering all mutation scenarios including edge cases |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
else | ||
{ | ||
// Growing: insert copies of value at the end | ||
insert_value(value_cend(), value, new_length - current_size); |
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.
The variable 'value' is being passed to insert_value, but the parameter is named 'value' in the function signature. This creates a name collision and could lead to confusion. The function parameter should be used here instead.
Copilot uses AI. Check for mistakes.
proxy.update_buffers(); | ||
|
||
// Return iterator to element after last erased, or end if we erased to the end | ||
return erase_index < new_size ? sparrow::next(value_begin(), erase_index) : value_end(); |
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.
[nitpick] The variable name 'erase_index_bis' used earlier (line 1450) suggests there might be naming conflicts. Consider using more descriptive variable names to avoid confusion between the two erase_index variables.
Copilot uses AI. Check for mistakes.
No description provided.