]> git.mxchange.org Git - simgear.git/commitdiff
cppbind: use Hash iterators to extract simgear::Map
authorThomas Geymayer <tomgey@gmail.com>
Fri, 30 May 2014 21:59:36 +0000 (23:59 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Fri, 30 May 2014 21:59:36 +0000 (23:59 +0200)
simgear/nasal/cppbind/NasalHash.hxx

index a800e5badb20cf202271bafc49e79d4e76b6f4c7..641644c25da51ca3641a5701ab06321822ecc299 100644 (file)
@@ -286,11 +286,10 @@ from_nasal_helper( naContext c,
                    const simgear::Map<std::string, Value>* )
 {
   nasal::Hash hash = from_nasal_helper(c, ref, static_cast<nasal::Hash*>(0));
-  std::vector<std::string> const& keys = hash.keys();
 
   simgear::Map<std::string, Value> map;
-  for(size_t i = 0; i < keys.size(); ++i)
-    map[ keys[i] ] = hash.get<Value>(keys[i]);
+  for(nasal::Hash::const_iterator it = hash.begin(); it != hash.end(); ++it)
+    map[ it->getKey() ] = it->getValue<Value>();
 
   return map;
 }