summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2009-05-04 20:27:54 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2009-05-04 20:27:54 +0000
commit486a4bb77ce26fe69529e579464f494e619d1922 (patch)
treebc5c1551137f60c0ddebca23102280e436b717bb /src
parent8feb215c20a5e63507ed368ac107dc1782d164ad (diff)
Fix unnecessary heap allocation on rehash: stack allocated ConfigReader is fine.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11359 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_override.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp
index a1e78812d..8f0b0aa2d 100644
--- a/src/modules/m_override.cpp
+++ b/src/modules/m_override.cpp
@@ -48,22 +48,20 @@ class ModuleOverride : public Module
virtual void OnRehash(User* user, const std::string &parameter)
{
// on a rehash we delete our classes for good measure and create them again.
- ConfigReader* Conf = new ConfigReader(ServerInstance);
+ ConfigReader Conf(ServerInstance);
// re-read our config options on a rehash
- NoisyOverride = Conf->ReadFlag("override", "noisy", 0);
- RequireKey = Conf->ReadFlag("override", "requirekey", 0);
+ NoisyOverride = Conf.ReadFlag("override", "noisy", 0);
+ RequireKey = Conf.ReadFlag("override", "requirekey", 0);
overrides.clear();
- for (int j =0; j < Conf->Enumerate("type"); j++)
+ for (int j =0; j < Conf.Enumerate("type"); j++)
{
- std::string typen = Conf->ReadValue("type","name",j);
- std::string tokenlist = Conf->ReadValue("type","override",j);
+ std::string typen = Conf.ReadValue("type","name",j);
+ std::string tokenlist = Conf.ReadValue("type","override",j);
overrides[typen] = tokenlist;
}
-
- delete Conf;
}