Fix bad code in Keeper (found by PVS-Studio)

This commit is contained in:
Alexey Milovidov 2021-05-08 17:10:06 +03:00
parent 7ca0f46708
commit 241c7a94da

View File

@ -103,7 +103,8 @@ struct KeeperStorageSyncRequest final : public KeeperStorageRequest
std::pair<Coordination::ZooKeeperResponsePtr, Undo> process(KeeperStorage::Container & /* container */, KeeperStorage::Ephemerals & /* ephemerals */, int64_t /* zxid */, int64_t /* session_id */) const override std::pair<Coordination::ZooKeeperResponsePtr, Undo> process(KeeperStorage::Container & /* container */, KeeperStorage::Ephemerals & /* ephemerals */, int64_t /* zxid */, int64_t /* session_id */) const override
{ {
auto response = zk_request->makeResponse(); auto response = zk_request->makeResponse();
dynamic_cast<Coordination::ZooKeeperSyncResponse *>(response.get())->path = dynamic_cast<Coordination::ZooKeeperSyncRequest *>(zk_request.get())->path; dynamic_cast<Coordination::ZooKeeperSyncResponse &>(*response).path
= dynamic_cast<Coordination::ZooKeeperSyncRequest &>(*zk_request).path;
return {response, {}}; return {response, {}};
} }
}; };