The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: kniederk on November 22, 2010, 01:10:47 PM

Title: bug in vector_tpl.h
Post by: kniederk on November 22, 2010, 01:10:47 PM
Hi,

I believe that the copy-constructor in tpl/vector_tpl.h in line 31 should read

count( copy_from.get_count() )

instead of

count( copy_from.get_size() )

otherwise there might be a lot of copying of empty data slots.

Klaus
Title: Re: bug in vector_tpl.h
Post by: prissi on November 22, 2010, 02:56:44 PM
That was a bad bug. Luckily this copy constructor was mostly called with completely filled vectors ...

Thanks!
Title: Re: bug in vector_tpl.h
Post by: kniederk on November 25, 2010, 05:10:24 PM
Of course, the right solution would be to port everything to the std:vector<..> templates to avoid this. ;)
Klaus