Skip to content

Commit

Permalink
Add usage of std::move where compiler suggested
Browse files Browse the repository at this point in the history
  • Loading branch information
torwig committed Feb 12, 2024
1 parent af18420 commit 8d0f64c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/config/config_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class IntegerField : public ConfigField {
}
Status Set(const std::string &v) override {
auto s = ParseInt<IntegerType>(v, {min_, max_});
if (!s.IsOK()) return s;
if (!s.IsOK()) return std::move(s);
*receiver_ = s.GetValue();
return Status::OK();
}
Expand All @@ -164,7 +164,7 @@ class OctalField : public ConfigField {
}
Status Set(const std::string &v) override {
auto s = ParseInt<int>(v, {min_, max_}, 8);
if (!s.IsOK()) return s;
if (!s.IsOK()) return std::move(s);
*receiver_ = *s;
return Status::OK();
}
Expand Down
5 changes: 3 additions & 2 deletions src/storage/storage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Status Storage::CreateColumnFamilies(const rocksdb::Options &options) {
return Status::OK();
}

return res;
return std::move(res);
}

return Status::OK();
Expand Down Expand Up @@ -434,7 +434,8 @@ Status Storage::RestoreFromBackup() {
// We must reopen the backup engine every time, as the files is changed
rocksdb::BackupEngineOptions bk_option(config_->backup_sync_dir);
auto bes = util::BackupEngineOpen(db_->GetEnv(), bk_option);
if (!bes) return bes;
if (!bes) return std::move(bes);

backup_ = std::move(*bes);

auto s = backup_->RestoreDBFromLatestBackup(config_->db_dir, config_->db_dir);
Expand Down

0 comments on commit 8d0f64c

Please sign in to comment.