# HG changeset patch # User Jaroslav Hajek # Date 1239964713 -7200 # Node ID 17a3df1d992bf75285c8005805400e66913fabd7 # Parent c71fe7045aa0beefd4f8f3fcfe7ee811b9054c10 avoid double lookups when iterating Octave_map diff -r c71fe7045aa0 -r 17a3df1d992b src/ChangeLog --- a/src/ChangeLog Fri Apr 17 11:47:02 2009 +0200 +++ b/src/ChangeLog Fri Apr 17 12:38:33 2009 +0200 @@ -1,3 +1,8 @@ +2009-04-17 Jaroslav Hajek + + * oct-map.h (Octave_map::contents (const_iterator) const, + Octave_map::contents (iterator)): Simplify. + 2009-04-17 Jaroslav Hajek * oct-map.cc (Octave_map::assign (const octave_value_list&, const diff -r c71fe7045aa0 -r 17a3df1d992b src/oct-map.h --- a/src/oct-map.h Fri Apr 17 11:47:02 2009 +0200 +++ b/src/oct-map.h Fri Apr 17 12:38:33 2009 +0200 @@ -133,11 +133,11 @@ Cell& contents (const std::string& k); Cell contents (const std::string& k) const; - Cell& contents (const_iterator p) - { return contents (key(p)); } + Cell& contents (iterator p) + { return p->second; } Cell contents (const_iterator p) const - { return contents (key(p)); } + { return p->second; } int intfield (const std::string& k, int def_val = 0) const;