From 3075cc7bd0aa6db5752e76183c267d091584705f Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 3 Nov 2020 22:30:58 +0000 Subject: Move config typedefs to ServerConfig and use auto in more places. --- src/configreader.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/configreader.cpp') diff --git a/src/configreader.cpp b/src/configreader.cpp index c70777ec1..5fd50252d 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -447,7 +447,7 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid) try { // Ensure the user has actually edited ther config. - ConfigTagList dietags = ConfTags("die"); + auto dietags = ConfTags("die"); if (!dietags.empty()) { errstr << "Your configuration has not been edited correctly!" << std::endl; @@ -476,7 +476,7 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid) if (valid) ServerInstance->WritePID(!old); - ConfigTagList binds = ConfTags("bind"); + auto binds = ConfTags("bind"); if (binds.empty()) errstr << "Possible configuration error: you have not defined any blocks." << std::endl << "You will need to do this if you want clients to be able to connect!" << std::endl; @@ -614,9 +614,9 @@ void ServerConfig::ApplyModules(User* user) } } -std::shared_ptr ServerConfig::ConfValue(const std::string &tag) +std::shared_ptr ServerConfig::ConfValue(const std::string& tag) { - std::pair found = config_data.equal_range(tag); + auto found = config_data.equal_range(tag); if (found.first == found.second) return EmptyTag; @@ -628,9 +628,9 @@ std::shared_ptr ServerConfig::ConfValue(const std::string &tag) return rv; } -ConfigTagList ServerConfig::ConfTags(const std::string& tag) +ServerConfig::TagList ServerConfig::ConfTags(const std::string& tag) { - return stdalgo::iterator_range(config_data.equal_range(tag)); + return ServerConfig::TagList(config_data.equal_range(tag)); } std::string ServerConfig::Escape(const std::string& str) -- cgit v1.3.1-10-gc9f91