}
else
{
- std::map<std::string, std::string>::iterator var = stack.vars.find(varname);
+ insp::flat_map<std::string, std::string>::iterator var = stack.vars.find(varname);
if (var == stack.vars.end())
throw CoreException("Undefined XML entity reference '&" + varname + ";'");
value.append(var->second);
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 */
bool ConfigTag::readString(const std::string& key, std::string& value, bool allow_lf)
{
- if (!this)
- return false;
for(std::vector<KeyVal>::iterator j = items.begin(); j != items.end(); ++j)
{
if(j->first != key)