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

Dead code in log_reader.cc #517

Closed
C0deAi opened this issue Oct 17, 2017 · 0 comments
Closed

Dead code in log_reader.cc #517

C0deAi opened this issue Oct 17, 2017 · 0 comments
Assignees
Labels

Comments

@C0deAi
Copy link

C0deAi commented Oct 17, 2017

The variables offset_in_block and in_fragmented_record are assigned but not used.

@cmumford cmumford self-assigned this Oct 18, 2017
@cmumford cmumford added the bug label Oct 18, 2017
@cmumford cmumford reopened this Oct 18, 2017
@pwnall pwnall closed this as completed in 3da4d8b Nov 3, 2017
Alexhuszagh pushed a commit to Alexhuszagh/leveldb that referenced this issue Nov 8, 2017
Deleted two unused assignments:

1. offset_in_block in Reader::SkipToInitialBlock().
2. in_fragmented_record in Reader::ReadRecord().

Reasons for the change:
1. offset_in_block is not read again after the if condition.
2. The kFullRecordType switch branch returns, so
   in_fragmented_record isn't read again.
3. The kFirstType switch branch sets in_fragmented_record to
   true after the if, so the write in the if is ignored.

Change contributed by @C0deAi on GitHub.

This fixes google#517

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172763897
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants