Skip to content

Commit f2c04ae

Browse files
committed
---
yaml --- r: 148073 b: refs/heads/try2 c: 7e446af h: refs/heads/master i: 148071: 5456aba v: v3
1 parent 478494b commit f2c04ae

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 3395f9d6a10aa912ab88de2e8d5b4f7de407413a
8+
refs/heads/try2: 7e446af759e86e77a5f4a8e9bc6d6c22072b25ae
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libstd/trie.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -198,24 +198,24 @@ macro_rules! bound {
198198
addr!(loop {
199199
let children = unsafe {addr!(& $($mut_)* (*node).children)};
200200
let child_id = chunk(key, idx);
201-
match children[child_id] {
201+
let (slice_idx, ret) = match children[child_id] {
202202
Internal(ref $($mut_)* n) => {
203203
node = addr!(& $($mut_)* **n as * $($mut_)* TrieNode<T>);
204+
(child_id + 1, false)
204205
}
205206
External(stored, _) => {
206-
if stored < key || ($upper && stored == key) {
207-
it.stack.push(children.$slice_from(child_id + 1).$iter());
207+
(if stored < key || ($upper && stored == key) {
208+
child_id + 1
208209
} else {
209-
it.stack.push(children.$slice_from(child_id).$iter());
210-
}
211-
return it;
210+
child_id
211+
}, true)
212212
}
213213
Nothing => {
214-
it.stack.push(children.$slice_from(child_id + 1).$iter());
215-
return it
214+
(child_id + 1, true)
216215
}
217-
}
218-
it.stack.push(children.$slice_from(child_id + 1).$iter());
216+
};
217+
it.stack.push(children.$slice_from(slice_idx).$iter());
218+
if ret { return it }
219219
idx += 1;
220220
})
221221
}

0 commit comments

Comments
 (0)