File tree Expand file tree Collapse file tree 2 files changed +18
-26
lines changed Expand file tree Collapse file tree 2 files changed +18
-26
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 9ff6f816ba5e9a1a32fc7e15a5b30f5b057ed199
2
+ refs/heads/master: a09dcd94c5809bd5cbedd5c06218e8db25c2881a
Original file line number Diff line number Diff line change @@ -1196,31 +1196,23 @@ mod node {
1196
1196
proportional to the height of the rope + the (bounded)
1197
1197
length of the largest leaf.
1198
1198
*/
1199
- fn char_at ( node : @node , pos : uint ) -> char {
1200
- let node = node;
1201
- let pos = pos;
1202
- while true {
1203
- alt ( * node) {
1204
- leaf ( x) {
1205
- ret str:: char_at ( * x. content , pos) ;
1206
- }
1207
- concat ( { left: left,
1208
- right: right,
1209
- char_len: _,
1210
- byte_len: _,
1211
- height: _} ) {
1212
- let left_len = char_len ( left) ;
1213
- if left_len > pos {
1214
- node = left;
1215
- } else {
1216
- node = right;
1217
- pos = pos - left_len;
1218
- }
1219
- }
1220
- }
1221
- } ;
1222
- fail; //unreachable
1223
- }
1199
+ fn char_at ( node : @node , pos : uint ) -> char {
1200
+ let node = node;
1201
+ let pos = pos;
1202
+ while true {
1203
+ alt * node {
1204
+ leaf( x) {
1205
+ ret str:: char_at ( * x. content , pos) ;
1206
+ }
1207
+ concat ( { left, right, _} ) {
1208
+ let left_len = char_len ( left) ;
1209
+ node = if left_len > pos { left }
1210
+ else { pos -= left_len; right } ;
1211
+ }
1212
+ }
1213
+ }
1214
+ fail; //unreachable
1215
+ }
1224
1216
1225
1217
mod leaf_iterator {
1226
1218
type t = {
You can’t perform that action at this time.
0 commit comments