Skip to content

Commit

Permalink
Merge pull request #119 from dhruvibm/1060
Browse files Browse the repository at this point in the history
Removed unwanted std::move operations
  • Loading branch information
aravynd authored Aug 24, 2023
2 parents 476867c + c76261e commit 08a75be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions dump_offload_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ int main(int argc, char** argv)
// Read arguments.
auto options = phosphor::dump::util::ArgumentParser(argc, argv);

std::string idStr = std::move((options)["id"]);
std::string idStr = (options)["id"];
if (idStr.empty())
{
ExitWithError("Dump id is not provided", argv);
}
auto id = std::stoi(idStr);

std::filesystem::path path = std::move((options)["path"]);
std::filesystem::path path = (options)["path"];
if (path.empty())
{
ExitWithError("Dump file path not specified.", argv);
}

std::string uri = std::move((options)["uri"]);
std::string uri = (options)["uri"];
if (path.empty())
{
ExitWithError("Dump offload uri not specified.", argv);
Expand Down
5 changes: 4 additions & 1 deletion dump_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ std::string getStateValue(const std::string& intf, const std::string& objPath,

reply.read(propertyVal);

stateVal = std::get<std::string>(propertyVal);
if (std::holds_alternative<std::string>(propertyVal))
{
stateVal = std::get<std::string>(propertyVal);
}
}
catch (const sdbusplus::exception_t& e)
{
Expand Down

0 comments on commit 08a75be

Please sign in to comment.