aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino
diff options
context:
space:
mode:
authorCristian Maglie <c.maglie@bug.st>2013-06-06 15:37:04 +0200
committerCristian Maglie <c.maglie@bug.st>2013-06-06 16:33:20 +0200
commit2719777a48418210563bf58199331eefe24969af (patch)
tree9a655f5e8bae7bfadfbcbe632ad9e706a10c48f3 /cores/arduino
parentd90fcca5839d13d57ed527d4009b78d22dafbde7 (diff)
String class: removed deep copy on substring method.
Small code cleanup.
Diffstat (limited to 'cores/arduino')
-rw-r--r--cores/arduino/WString.cpp5
-rw-r--r--cores/arduino/WString.h2
2 files changed, 1 insertions, 6 deletions
diff --git a/cores/arduino/WString.cpp b/cores/arduino/WString.cpp
index c6839fc..77bdd8a 100644
--- a/cores/arduino/WString.cpp
+++ b/cores/arduino/WString.cpp
@@ -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) {
diff --git a/cores/arduino/WString.h b/cores/arduino/WString.h
index 642b016..8938bf9 100644
--- a/cores/arduino/WString.h
+++ b/cores/arduino/WString.h
@@ -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