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:
+4
-2
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user