diff options
author | Darkvater <darkvater@openttd.org> | 2007-02-20 00:01:54 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2007-02-20 00:01:54 +0000 |
commit | 5b237758aaf4ba5d646ccfad2129312f30bfcfb2 (patch) | |
tree | be7d6f569de5d6510195c2554c952e12683ed72b /src/newgrf_config.cpp | |
parent | f79618118f7f6d06b001c40eb83ee5f0fbbfa8e7 (diff) | |
download | openttd-5b237758aaf4ba5d646ccfad2129312f30bfcfb2.tar.xz |
(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.
Diffstat (limited to 'src/newgrf_config.cpp')
-rw-r--r-- | src/newgrf_config.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/newgrf_config.cpp b/src/newgrf_config.cpp index 24d9727ff..583b4773b 100644 --- a/src/newgrf_config.cpp +++ b/src/newgrf_config.cpp @@ -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); |