diff options
author | Olly Betts <olly@survex.com> | 2007-09-17 20:10:57 +0000 |
---|---|---|
committer | Olly Betts <olly@survex.com> | 2007-09-17 20:10:57 +0000 |
commit | c836c81acba5ad6815032ccadd13a40bddef607b (patch) | |
tree | 9c0f3c56033900f2e9fe333075fe5d304a4a1e32 /Lib/mzscheme | |
parent | ef4ca158de95ba31f8255fa1008b1773b2d05258 (diff) | |
download | swig-c836c81acba5ad6815032ccadd13a40bddef607b.tar.gz |
When wrapping C++ code, generate code which uses
std::string::assign(PTR, LEN) rather than assigning
std::string(PTR, LEN). Using assign generates more efficient code
(tested with GCC 4.1.2).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9936 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib/mzscheme')
-rw-r--r-- | Lib/mzscheme/std_string.i | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/mzscheme/std_string.i b/Lib/mzscheme/std_string.i index aa27bc0d8..c9a82efe4 100644 --- a/Lib/mzscheme/std_string.i +++ b/Lib/mzscheme/std_string.i @@ -33,14 +33,14 @@ namespace std { %typemap(in) string { if (SCHEME_STRINGP($input)) - $1 = std::string(SCHEME_STR_VAL($input)); + $1.assign(SCHEME_STR_VAL($input)); else SWIG_exception(SWIG_TypeError, "string expected"); } %typemap(in) const string & (std::string temp) { if (SCHEME_STRINGP($input)) { - temp = std::string(SCHEME_STR_VAL($input)); + temp.assign(SCHEME_STR_VAL($input)); $1 = &temp; } else { SWIG_exception(SWIG_TypeError, "string expected"); |