Set string contents when we allocate it for a small efficiency gain.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12052 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Olly Betts 2010-05-25 21:46:23 +00:00
commit 08cdb5a7ee

View file

@ -71,8 +71,7 @@ namespace std {
%typemap(directorout) string & (std::string *temp) %{
convert_to_string_ex($input);
temp = new std::string;
temp->assign(Z_STRVAL_PP($input), Z_STRLEN_PP($input));
temp = new std::string(Z_STRVAL_PP($input), Z_STRLEN_PP($input));
swig_acquire_ownership(temp);
$result = temp;
%}