String class: removed deep copy on substring method.

Small code cleanup.
This commit is contained in:
Cristian Maglie 2013-06-06 15:37:04 +02:00
parent d90fcca583
commit 2719777a48
2 changed files with 1 additions and 6 deletions

View File

@ -527,11 +527,6 @@ int String::lastIndexOf(const String &s2, unsigned int fromIndex) const
return found;
}
String String::substring( unsigned int left ) const
{
return substring(left, len);
}
String String::substring(unsigned int left, unsigned int right) const
{
if (left > right) {

View File

@ -158,7 +158,7 @@ public:
int lastIndexOf( char ch, unsigned int fromIndex ) const;
int lastIndexOf( const String &str ) const;
int lastIndexOf( const String &str, unsigned int fromIndex ) const;
String substring( unsigned int beginIndex ) const;
String substring( unsigned int beginIndex ) const { return substring(beginIndex, len); };
String substring( unsigned int beginIndex, unsigned int endIndex ) const;
// modification