(svn r8820) -Codechange (r8807, r8806): Remove the unneeded calloc/free allocation of GRFConfig and turn it into a simple variable (it's supposed to be data-only). Thanks Tron.

This commit is contained in:
Darkvater
2007-02-20 00:01:54 +00:00
parent f79618118f
commit 5b237758aa
2 changed files with 16 additions and 12 deletions

View File

@@ -465,12 +465,13 @@ static void Save_NGRF(void)
static void Load_NGRF(void)
{
GRFConfig *c = CallocT<GRFConfig>(1);
GRFConfig c;
memset(&c, 0, sizeof(GRFConfig));
while (SlIterateArray() != -1) {
SlObject(c, _grfconfig_desc);
AppendToGRFConfigList(&_grfconfig, c);
SlObject(&c, _grfconfig_desc);
AppendToGRFConfigList(&_grfconfig, &c);
}
free(c);
/* Append static NewGRF configuration */
AppendStaticGRFConfigs(&_grfconfig);