Don't return a bool from PluginLoader::Load().

It never returns false, so there's no point returning true.
This commit is contained in:
Oliver Hamlet
2015-07-13 09:58:37 +01:00
parent 8283522c50
commit e7588fc267
3 changed files with 11 additions and 5 deletions
+2 -1
View File
@@ -233,7 +233,8 @@ namespace loot {
try {
PluginLoader loader;
return loader.Load(game, name, true, true);
loader.Load(game, name, true, true);
return true;
}
catch (std::exception& /*e*/) {
BOOST_LOG_TRIVIAL(warning) << "The .es(p|m) file \"" << name << "\" is not a valid plugin.";
+5 -3
View File
@@ -38,7 +38,10 @@ using namespace std;
namespace loot {
PluginLoader::PluginLoader() : _isEmpty(true), _isMaster(false), _crc(0) {}
bool PluginLoader::Load(const Game& game, const std::string& name, const bool headerOnly, const bool checkValidityOnly) {
void PluginLoader::Load(const Game& game,
const std::string& name,
const bool headerOnly,
const bool checkValidityOnly) {
espm::File * file = nullptr;
espm::Settings espmSettings;
@@ -71,7 +74,7 @@ namespace loot {
// If only wanting to test for valid parsing, quit now.
if (checkValidityOnly) {
delete file;
return true;
return;
}
BOOST_LOG_TRIVIAL(trace) << filepath.filename() << ": " << "Checking master flag.";
@@ -116,7 +119,6 @@ namespace loot {
}
BOOST_LOG_TRIVIAL(trace) << name << ": " << "Plugin loading complete.";
return true;
}
bool PluginLoader::IsEmpty() const {
+4 -1
View File
@@ -38,7 +38,10 @@ namespace loot {
public:
PluginLoader();
bool Load(const Game& game, const std::string& name, const bool headerOnly, const bool checkValidityOnly);
void Load(const Game& game,
const std::string& name,
const bool headerOnly,
const bool checkValidityOnly);
bool IsEmpty() const;
bool IsMaster() const; //Checks master bit flag.