diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-06-09 17:13:31 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-06-09 17:13:31 +0200 |
commit | 4a77f472fd5bad95f1e4e26835317533d988ea15 (patch) | |
tree | 2bc048104fa2ce7aeaeffec513e1a383374cc76c /src/configparser.cpp | |
parent | f3c6c6123da841537b10598e766e1b61a7e66b54 (diff) |
Use std::find() in ParseStack::ParseFile()
Diffstat (limited to 'src/configparser.cpp')
-rw-r--r-- | src/configparser.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/configparser.cpp b/src/configparser.cpp index 51b248133..60770d16d 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -367,13 +367,8 @@ 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()); - for (unsigned int t = 0; t < reading.size(); t++) - { - if (path == reading[t]) - { - throw CoreException((isexec ? "Executable " : "File ") + path + " is included recursively (looped inclusion)"); - } - } + if (std::find(reading.begin(), reading.end(), path) != reading.end()) + 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 */ |