Skip to content
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

chore(zset_family/score_map): Replace sds arguments with string_view #4738

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abhijat
Copy link
Contributor

@abhijat abhijat commented Mar 10, 2025

The usages of WrapSds are removed from zset_family calls.

In most cases it is a straightforward change to use string_view or string_view.data(), string_view.size().

In one case a wrapper had to be introduced.

fixes #4639

@abhijat abhijat changed the title chore(zset_family/score_map): Remove usages of sds [wip] chore(zset_family/score_map): Remove usages of sds Mar 10, 2025
@abhijat abhijat changed the title [wip] chore(zset_family/score_map): Remove usages of sds [wip] chore(zset_family/score_map): Replace sds arguments with string_view Mar 10, 2025
@abhijat
Copy link
Contributor Author

abhijat commented Mar 24, 2025

test failure seems related to this change:

src/redis/listpack.c:886]: assert((p) >= (lp)+LP_HDR_SIZE && (p)+(replaced_len) < (lp)+lpGetTotalBytes((lp))) failed!

passing in an empty string view ends up being treated as nullptr of zero size, which is different from the behavior for sds

@abhijat
Copy link
Contributor Author

abhijat commented Mar 24, 2025

passing in an empty string view ends up being treated as nullptr of zero size, which is different from the behavior for sds

reproducible by adding an empty field in unit test for zadd.

THe usages of WrapSds are removed from zset_family calls.

In most cases it is a straightforward change to use string_view or
string_view.data(), string_view.size(). In one case a wrapper had to be
introduced.

Signed-off-by: Abhijat Malviya <[email protected]>
@abhijat abhijat force-pushed the abhijat/chore/cleanup_sds_in_sorted_map branch from db97e4f to 24b3723 Compare March 25, 2025 10:44
@abhijat abhijat changed the title [wip] chore(zset_family/score_map): Replace sds arguments with string_view chore(zset_family/score_map): Replace sds arguments with string_view Mar 25, 2025
@abhijat abhijat requested review from romange and kostasrim March 25, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get rid of sds arguments in SortedMap
1 participant