-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix: clang warnings. #508
fix: clang warnings. #508
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -871,7 +871,7 @@ error_code ServerFamily::DoSave(bool new_version, Transaction* trans, string* er | |
const auto scripts = script_mgr_->GetLuaScripts(); | ||
auto& summary_snapshot = snapshots[shard_set->size()]; | ||
summary_snapshot.reset(new RdbSnapshot(fq_threadpool_.get())); | ||
if (ec = DoPartialSave(filename, path, start, scripts, summary_snapshot.get(), nullptr)) { | ||
if ((ec = DoPartialSave(filename, path, start, scripts, summary_snapshot.get(), nullptr))) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as the previous comment - I think that it would look more like the intent is to assign then check. assign with side effect is the classic that you;re not sure if this is a bug or you're using the side effect |
||
summary_snapshot.reset(); | ||
} | ||
} | ||
|
@@ -880,7 +880,7 @@ error_code ServerFamily::DoSave(bool new_version, Transaction* trans, string* er | |
auto cb = [&](Transaction* t, EngineShard* shard) { | ||
auto& snapshot = snapshots[shard->shard_id()]; | ||
snapshot.reset(new RdbSnapshot(fq_threadpool_.get())); | ||
if (ec = DoPartialSave(filename, path, start, {}, snapshot.get(), shard)) { | ||
if ((ec = DoPartialSave(filename, path, start, {}, snapshot.get(), shard))) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same issue as with above |
||
snapshot.reset(); | ||
} | ||
return OpStatus::OK; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe the new still "if" with "if (ec = shard_flows_[id]->StartFullSyncFlow(&sb); ec) {..} would be more readable? right now this look a little bit like a classic C bug where you're assign and then git the side effect from assignment.