nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eb35f7e
)
lib/standard/string: Proper handling of trivial cases in substring_from.
author
Lucas Bajolet
<r4pass@hotmail.com>
Fri, 29 Aug 2014 19:45:34 +0000
(15:45 -0400)
committer
Lucas Bajolet
<r4pass@hotmail.com>
Tue, 2 Sep 2014 20:16:29 +0000
(16:16 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
lib/standard/string.nit
patch
|
blob
|
history
diff --git
a/lib/standard/string.nit
b/lib/standard/string.nit
index
821672e
..
22c32e8
100644
(file)
--- a/
lib/standard/string.nit
+++ b/
lib/standard/string.nit
@@
-178,7
+178,7
@@
abstract class Text
# As with substring, a `from` index < 0 will be replaced by 0
fun substring_from(from: Int): SELFTYPE
do
- if from > self.length then return empty
+ if from >= self.length then return empty
if from < 0 then from = 0
return substring(from, length - from)
end