Commit 6fcd3d53 authored by december0123's avatar december0123

Readability

parent ad36c5a1
......@@ -10,11 +10,11 @@
#include <vector>
#include "Config.hpp"
Config::Config(std::string configPath, std::string type)
: type_(type), basePath_(configPath.substr(0, configPath.find_last_of('/'))),
configPath_(configPath)
{
// Add new HardwareIDs group to vector if vector is empty
if (hwdIDs_.empty())
{
Config::HardwareID hwdID;
......@@ -38,9 +38,9 @@ bool Config::readConfigFile(std::string configPath)
while (!file.eof())
{
getline(file, line);
std::getline(file, line);
size_t pos = line.find_first_of('#');
std::size_t pos = line.find_first_of('#');
if (pos != std::string::npos)
{
line.erase(pos);
......
......@@ -672,7 +672,6 @@ std::vector<std::string> Data::getRecursiveDirectoryFileList(const std::string d
return list;
}
Vita::string Data::getRightConfigPath(Vita::string str, Vita::string baseConfigPath)
{
str = str.trim();
......
......@@ -1249,7 +1249,7 @@ int Mhwd::launch(int argc, char *argv[])
printer_.printError("custom config '" + filepath + "' does not exist!");
return 1;
}
if (!S_ISREG(filestatus.st_mode))
else if (!S_ISREG(filestatus.st_mode))
{
printer_.printError("custom config '" + filepath + "' is invalid!");
return 1;
......@@ -1263,7 +1263,7 @@ int Mhwd::launch(int argc, char *argv[])
return 1;
}
if (!performTransaction(config_, MHWD::TRANSACTIONTYPE::INSTALL))
else if (!performTransaction(config_, MHWD::TRANSACTIONTYPE::INSTALL))
{
return 1;
}
......@@ -1304,7 +1304,7 @@ int Mhwd::launch(int argc, char *argv[])
return 1;
}
if (!performTransaction(config_, MHWD::TRANSACTIONTYPE::REMOVE))
else if (!performTransaction(config_, MHWD::TRANSACTIONTYPE::REMOVE))
{
delete config_;
return 1;
......
......@@ -22,5 +22,5 @@
int main(int argc, char *argv[])
{
Mhwd mhwd;
mhwd.launch(argc, argv);
return mhwd.launch(argc, argv);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment