diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-11-01 18:21:30 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-11-01 18:21:30 +0100 |
commit | 48f8f79317a04891e2becd859363add6eb2d6444 (patch) | |
tree | f92d080a4b552df405470662a31fc5e4a923882d /src/configparser.cpp | |
parent | fbc73e20784b055485f676096e758d6aeed62e0c (diff) |
Add stdalgo::isin() and use it to simplify code
Diffstat (limited to 'src/configparser.cpp')
-rw-r--r-- | src/configparser.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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 */ |