Skip to content

Commit cf5c8cf

Browse files
committed
cleanup rsplit corner case
git-svn-id: http://pystring.googlecode.com/svn/trunk@4 e90ac086-db91-11dd-a3d5-f9b94b98161c
1 parent e86429c commit cf5c8cf

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

pystring.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,17 +167,14 @@ namespace pystring
167167
///
168168
void rsplit( const std::string & str, std::vector< std::string > & result, const std::string & sep, int maxsplit )
169169
{
170-
if ( maxsplit == 0 )
171-
{
172-
split( str, result, sep, 0 );
173-
return;
174-
}
170+
if ( maxsplit < 0 )
171+
{
172+
split( str, result, sep, 0 );
173+
return;
174+
}
175175

176176
result.clear();
177177

178-
if ( maxsplit < 0 ) maxsplit = MAX_32BIT_INT;//result.max_size();
179-
180-
181178
if ( sep.size() == 0 )
182179
{
183180
rsplit_whitespace( str, result, maxsplit );

0 commit comments

Comments
 (0)