From: Thomas Geymayer Date: Fri, 30 May 2014 21:59:36 +0000 (+0200) Subject: cppbind: use Hash iterators to extract simgear::Map X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=be358f8d24120908f3983665e301487e9c8af0d6;p=simgear.git cppbind: use Hash iterators to extract simgear::Map --- diff --git a/simgear/nasal/cppbind/NasalHash.hxx b/simgear/nasal/cppbind/NasalHash.hxx index a800e5ba..641644c2 100644 --- a/simgear/nasal/cppbind/NasalHash.hxx +++ b/simgear/nasal/cppbind/NasalHash.hxx @@ -286,11 +286,10 @@ from_nasal_helper( naContext c, const simgear::Map* ) { nasal::Hash hash = from_nasal_helper(c, ref, static_cast(0)); - std::vector const& keys = hash.keys(); simgear::Map map; - for(size_t i = 0; i < keys.size(); ++i) - map[ keys[i] ] = hash.get(keys[i]); + for(nasal::Hash::const_iterator it = hash.begin(); it != hash.end(); ++it) + map[ it->getKey() ] = it->getValue(); return map; }