Skip to content

Remove redundant count division in genericHgetallCommand#3573

Merged
ranshid merged 1 commit into
valkey-io:unstablefrom
djk1027:cleanup/hgetall-dead-count-assignment
Apr 28, 2026
Merged

Remove redundant count division in genericHgetallCommand#3573
ranshid merged 1 commit into
valkey-io:unstablefrom
djk1027:cleanup/hgetall-dead-count-assignment

Conversation

@djk1027

@djk1027 djk1027 commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

The argument count /= 2 modifies count as a side effect, and the following count /= 2 divides it again unnecessarily.
Since count is not used after this point, fix it by using count / 2 without the side effect and remove the redundant second assignment.

Signed-off-by: djk1027 <djk9510271@gmail.com>
@djk1027 djk1027 force-pushed the cleanup/hgetall-dead-count-assignment branch from e00b8ea to 81c9d49 Compare April 28, 2026 04:13
@enjoy-binbin enjoy-binbin requested a review from ranshid April 28, 2026 06:59
@codecov

codecov Bot commented Apr 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.46%. Comparing base (ff80b2d) to head (81c9d49).
⚠️ Report is 1 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #3573      +/-   ##
============================================
- Coverage     76.66%   76.46%   -0.21%     
============================================
  Files           159      159              
  Lines         80114    80113       -1     
============================================
- Hits          61423    61257     -166     
- Misses        18691    18856     +165     
Files with missing lines Coverage Δ
src/t_hash.c 95.63% <100.00%> (+0.23%) ⬆️

... and 21 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ranshid ranshid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@ranshid ranshid merged commit 8091c6c into valkey-io:unstable Apr 28, 2026
59 checks passed
abmathur-ie pushed a commit to abmathur-ie/valkey that referenced this pull request Apr 29, 2026
)

The argument `count /= 2` modifies `count` as a side effect, and the
following `count /= 2` divides it again unnecessarily.
Since `count` is not used after this point, fix it by using `count / 2`
without the side effect and remove the redundant second assignment.

Signed-off-by: djk1027 <djk9510271@gmail.com>
Signed-off-by: Abhishek Mathur <matshek@amazon.com>
lucasyonge pushed a commit that referenced this pull request May 11, 2026
The argument `count /= 2` modifies `count` as a side effect, and the
following `count /= 2` divides it again unnecessarily.
Since `count` is not used after this point, fix it by using `count / 2`
without the side effect and remove the redundant second assignment.

Signed-off-by: djk1027 <djk9510271@gmail.com>
lucasyonge pushed a commit that referenced this pull request May 12, 2026
The argument `count /= 2` modifies `count` as a side effect, and the
following `count /= 2` divides it again unnecessarily.
Since `count` is not used after this point, fix it by using `count / 2`
without the side effect and remove the redundant second assignment.

Signed-off-by: djk1027 <djk9510271@gmail.com>
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.

3 participants