Mercurial > hg > octave-lyh
changeset 10381:1aa8b9b8f921
str2double.cc: style fix
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 01 Mar 2010 15:10:03 -0500 |
parents | 60acc47c203f |
children | 1766c133674c |
files | src/ChangeLog src/DLD-FUNCTIONS/str2double.cc |
diffstat | 2 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-03-01 John W. Eaton <jwe@octave.org> + + * (str2double1): Pass argument as const reference and make + explicit copy instead of passing by value. + 2010-03-01 John W. Eaton <jwe@octave.org> * DLD-FUNCTIONS/str2double.cc (set_component): Use autoconf
--- a/src/DLD-FUNCTIONS/str2double.cc +++ b/src/DLD-FUNCTIONS/str2double.cc @@ -158,10 +158,14 @@ } static Complex -str2double1 (std::string str) +str2double1 (const std::string& str_arg) { Complex val (0.0, 0.0); + + std::string str = str_arg; + std::string::iterator se = str.end (); + // Remove commas (thousand separators) and spaces. se = std::remove (str.begin (), se, ','); se = std::remove (str.begin (), se, ' ');