From 049e51c2822e8b10834dca51f90483949b3a8101 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Fri, 18 Feb 2011 08:44:44 +0000 Subject: [PATCH] Remove pointless special casing of zero-length strings, remnant of a series of changes Marcelo made here. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12472 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/typemaps/std_strings.swg | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Lib/typemaps/std_strings.swg b/Lib/typemaps/std_strings.swg index b7e8f6d52..e9c23ba91 100644 --- a/Lib/typemaps/std_strings.swg +++ b/Lib/typemaps/std_strings.swg @@ -40,11 +40,7 @@ SWIG_AsPtr_dec(String)(SWIG_Object obj, String **val) SWIGINTERNINLINE SWIG_Object SWIG_From_dec(String)(const String& s) { - if (s.size()) { - return SWIG_FromCharPtrAndSize(s.data(), s.size()); - } else { - return SWIG_FromCharPtrAndSize(s.c_str(), 0); - } + return SWIG_FromCharPtrAndSize(s.data(), s.size()); } } %enddef