X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fconfigparser.cpp;h=3be1ac9c53d39ce44f0a79dcd6d81defa55735f9;hb=63aa8d0d42f619c52d382bde3e6ba2e5e23b12ac;hp=51b2481338cdb5c31011ef26d6b7e90524432016;hpb=f3c6c6123da841537b10598e766e1b61a7e66b54;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/configparser.cpp b/src/configparser.cpp index 51b248133..3be1ac9c5 100644 --- a/src/configparser.cpp +++ b/src/configparser.cpp @@ -155,7 +155,7 @@ struct Parser } else { - std::map::iterator var = stack.vars.find(varname); + insp::flat_map::iterator var = stack.vars.find(varname); if (var == stack.vars.end()) throw CoreException("Undefined XML entity reference '&" + varname + ";'"); value.append(var->second); @@ -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 (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 */ @@ -390,8 +385,6 @@ bool ParseStack::ParseFile(const std::string& path, int flags, const std::string bool ConfigTag::readString(const std::string& key, std::string& value, bool allow_lf) { - if (!this) - return false; for(std::vector::iterator j = items.begin(); j != items.end(); ++j) { if(j->first != key)