Fix a clang analyze warning (#5398)

Summary:
Clang analyzer is reporting a false positive warning thinking `type` is uninitialized. The variable is initialized by `ParseFileName` by reference so assigning a default value to keep clang happy.
Current failure:
```
file/filename.cc:435:15: warning: The left operand of '==' is a garbage value
        (type == kInfoLogFile)) {
         ~~~~ ^
1 warning generated.
```
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5398

Differential Revision: D15588421

Pulled By: miasantreble

fbshipit-source-id: fb121c270300f3a659e68bc7f6674ff4ddf2df9a
main
Zhongyi Xie 5 years ago committed by Facebook Github Bot
parent cae22c53fb
commit d7d8605f56
  1. 2
      file/filename.cc

@ -413,7 +413,7 @@ Status GetInfoLogFiles(Env* env, const std::string& db_log_dir,
assert(parent_dir != nullptr);
assert(info_log_list != nullptr);
uint64_t number = 0;
FileType type;
FileType type = kLogFile;
if (!db_log_dir.empty()) {
*parent_dir = db_log_dir;

Loading…
Cancel
Save