mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 11:09:04 -04:00
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
This commit is contained in:
parent
8feb215c20
commit
486a4bb77c
@ -48,22 +48,20 @@ class ModuleOverride : public Module
|
||||
virtual void OnRehash(User* user, const std::string ¶meter)
|
||||
{
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user