File tree Expand file tree Collapse file tree 2 files changed +4
-19
lines changed Expand file tree Collapse file tree 2 files changed +4
-19
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 138c55a69d44371e4de04ed538c787dec46a7200
2
+ refs/heads/master: 330c9c6c3592496462dbf9aa716a37e048b00172
Original file line number Diff line number Diff line change @@ -96,25 +96,10 @@ fn buf(str s) -> sbuf {
96
96
}
97
97
98
98
fn bytes ( str s) -> vec[ u8 ] {
99
- /* FIXME (issue #58):
100
- * Should be...
101
- *
102
- * fn ith(str s, uint i) -> u8 {
103
- * ret s.(i);
104
- * }
105
- * ret _vec.init_fn[u8](bind ith(s, _), byte_len(s));
106
- *
107
- * but we do not correctly decrement refcount of s when
108
- * the binding dies, so we have to do this manually.
109
- */
110
- let uint n = _str. byte_len ( s) ;
111
- let vec[ u8] v = _vec. alloc [ u8] ( n) ;
112
- let uint i = 0 u;
113
- while ( i < n) {
114
- v += vec ( s. ( i) ) ;
115
- i += 1 u;
99
+ fn ith ( str s, uint i) -> u8 {
100
+ ret s. ( i) ;
116
101
}
117
- ret v ;
102
+ ret _vec . init_fn [ u8 ] ( bind ith ( s , _ ) , byte_len ( s ) ) ;
118
103
}
119
104
120
105
fn from_bytes ( vec[ u8] v ) : is_utf8( v ) -> str {
You can’t perform that action at this time.
0 commit comments