From 48f8f79317a04891e2becd859363add6eb2d6444 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Sat, 1 Nov 2014 18:21:30 +0100 Subject: Add stdalgo::isin() and use it to simplify code --- src/configparser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/configparser.cpp') diff --git a/src/configparser.cpp b/src/configparser.cpp index 89ad6493a..6b0d8fa04 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -367,7 +367,7 @@ void ParseStack::DoReadFile(const std::string& key, const std::string& name, int bool ParseStack::ParseFile(const std::string& path, int flags, const std::string& mandatory_tag, bool isexec) { ServerInstance->Logs->Log("CONFIG", LOG_DEBUG, "Reading (isexec=%d) %s", isexec, path.c_str()); - if (std::find(reading.begin(), reading.end(), path) != reading.end()) + if (stdalgo::isin(reading, path)) throw CoreException((isexec ? "Executable " : "File ") + path + " is included recursively (looped inclusion)"); /* It's not already included, add it to the list of files we've loaded */ -- cgit v1.2.3