[Scummvm-devel] Replacing Common::Map by std::map
Max Horn
max at quendi.de
Sat Jan 15 14:01:06 CET 2005
If nobody objects, I want to replace Common::Map by std::map and
std::set. I already did the necessary changes in my local checkout.
Worked quite fine; the binary size increased by 10kb or so, but since
the whole binary is 3.6 MB for me anyway, I don't think that matters.
(with MT32 disabled; with MT32, it's about 10 MB, but that is another
story :-/).
As I have argued many times in the past, I don't believe using std::map
will cause any portability issues, as is proven by e.g. Exult, which
runs on almost all the platforms we run on. Size is no issue, either.
Nor is speed.
OTOH, the advantage of using std::map is that we have to maintain less
code; we use well debugged code instead of the relatively bad
Common::Map class (which doesn't even use a balanced tree); we gain
lots of nifty features the STL provides for its map/set classes.
Ultimately, I also want to replace Common::String, Array, List (and
partially Stack). But Map is the worst of 'em all, implementation wise,
so I want to replace it first.
Bye,
Max
More information about the Scummvm-devel
mailing list