Mercurial > hg > octave-nkf
changeset 9129:17a3df1d992b
avoid double lookups when iterating Octave_map
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 17 Apr 2009 12:38:33 +0200 |
parents | c71fe7045aa0 |
children | 67fa54583fe8 |
files | src/ChangeLog src/oct-map.h |
diffstat | 2 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-04-17 Jaroslav Hajek <highegg@gmail.com> + + * oct-map.h (Octave_map::contents (const_iterator) const, + Octave_map::contents (iterator)): Simplify. + 2009-04-17 Jaroslav Hajek <highegg@gmail.com> * oct-map.cc (Octave_map::assign (const octave_value_list&, const
--- a/src/oct-map.h +++ b/src/oct-map.h @@ -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;