valkey
valkey copied to clipboard
Update the misleading zdiff() comment on empty first key handling.
Currently, zdiff() becomes a no-op in the case that the first key is empty.
The existing comment of "Skip everything if the smallest input is empty" is misleading, as qsort is bypassed for the case of ZDIFF. There's no guarantee that the first key holds the smallest cardinality.
The real reason behind such bypass is the following. ZDIFF computes the difference between the first and all successive input sorted sets. Meaning, if the first key is empty, we cannot reduce further from an already empty collection, and thus zdiff() becomes a no-op.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 72.22%. Comparing base (cef8822) to head (29722e8).
:warning: Report is 39 commits behind head on unstable.
Additional details and impacted files
@@ Coverage Diff @@
## unstable #747 +/- ##
============================================
+ Coverage 72.09% 72.22% +0.13%
============================================
Files 127 127
Lines 70774 70774
============================================
+ Hits 51021 51114 +93
+ Misses 19753 19660 -93
| Files with missing lines | Coverage Δ | |
|---|---|---|
| src/t_zset.c | 96.83% <ø> (ø) |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
@kyle-yh-kim Do you want to update this or should we close it?
Sure, I'll go ahead and update only the comment, and leave the code implementation as is - by Viktor's recommendation.
PR has been updated!