Initialize scratch to nullptr explicitly to make clang analyzer happy (#6577)

Summary:
`scratch` is not initialized in `Align` because it will be set outside of it. But clang analyzer is strict on initializing it before return.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6577

Test Plan: make analyze

Reviewed By: siying

Differential Revision: D20607303

Pulled By: cheng-chang

fbshipit-source-id: 2843d759345a057a8e122178d30b90deff0f9b2a
main
Cheng Chang 4 years ago committed by Facebook GitHub Bot
parent d300d10962
commit 43aee93d2b
  1. 1
      file/random_access_file_reader.cc

@ -163,6 +163,7 @@ FSReadRequest Align(const FSReadRequest& r, size_t alignment) {
req.offset = static_cast<uint64_t>(
TruncateToPageBoundary(alignment, static_cast<size_t>(r.offset)));
req.len = Roundup(End(r), alignment) - req.offset;
req.scratch = nullptr;
return req;
}

Loading…
Cancel
Save