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:
parent
465373d92d
commit
08cdb5a7ee
1 changed files with 1 additions and 2 deletions
|
|
@ -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;
|
||||
%}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue