Flesh out string byte handling a bit:

- Get rid of public byteAt(_) method on strings. It's redundant and
  longer than .bytes[_].
- Implement bytes.count natively so it's O(1).
This commit is contained in:
Bob Nystrom
2015-09-10 23:52:18 -07:00
parent adcb5bccba
commit bda9ad880a
9 changed files with 40 additions and 57 deletions
+4 -2
View File
@@ -137,9 +137,11 @@ class StringByteSequence is Sequence {
_string = string
}
[index] { _string.byteAt(index) }
[index] { _string.byteAt_(index) }
iterate(iterator) { _string.iterateByte_(iterator) }
iteratorValue(iterator) { _string.byteAt(iterator) }
iteratorValue(iterator) { _string.byteAt_(iterator) }
count { _string.byteCount_ }
}
class List is Sequence {