Remove unnecessary Plugin::operator< overload

This commit is contained in:
Oliver Hamlet
2020-07-11 19:14:06 +01:00
parent 062ab24139
commit 84286e0d5f
4 changed files with 1 additions and 28 deletions
-4
View File
@@ -261,10 +261,6 @@ uintmax_t Plugin::GetFileSize(std::filesystem::path pluginPath) {
return std::filesystem::file_size(pluginPath);
}
bool Plugin::operator<(const Plugin& rhs) const {
return CompareFilenames(name_, rhs.name_) < 0;
}
void Plugin::Load(const std::filesystem::path& path,
GameType gameType,
bool headerOnly) {
-2
View File
@@ -73,8 +73,6 @@ public:
const std::filesystem::path& pluginPath);
static uintmax_t GetFileSize(std::filesystem::path pluginPath);
bool operator<(const Plugin& rhs) const;
private:
void Load(const std::filesystem::path& path,
GameType gameType,
+1 -1
View File
@@ -200,7 +200,7 @@ void PluginGraph::AddPluginVertices(Game& game,
return true;
}
return *lhs < *rhs;
return lhs->GetName() < rhs->GetName();
});
for (const auto& plugin : loadedPlugins) {
-21
View File
@@ -437,27 +437,6 @@ TEST_P(PluginTest, getFileSizeShouldReturnCorrectValueForAGhostedPlugin) {
Plugin::GetFileSize(game_.DataPath() / blankMasterDependentEsm));
}
TEST_P(PluginTest,
lessThanOperatorShouldUseCaseInsensitiveLexicographicalNameComparison) {
Plugin plugin1(
game_.Type(), game_.GetCache(), game_.DataPath() / blankEsp, true);
Plugin plugin2(game_.Type(),
game_.GetCache(),
game_.DataPath() / lowercaseBlankEsp,
true);
EXPECT_FALSE(plugin1 < plugin2);
EXPECT_FALSE(plugin2 < plugin1);
Plugin plugin3 =
Plugin(game_.Type(), game_.GetCache(), game_.DataPath() / blankEsm, true);
Plugin plugin4 =
Plugin(game_.Type(), game_.GetCache(), game_.DataPath() / blankEsp, true);
EXPECT_TRUE(plugin3 < plugin4);
EXPECT_FALSE(plugin4 < plugin3);
}
TEST_P(PluginTest,
doFormIDsOverlapShouldReturnFalseIfTheArgumentIsNotAPluginObject) {
Plugin plugin1(