authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-05-17 00:52:36-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-05-17 00:52:36-04:00
log942d384831196acf24868c32ef84409b05441960
tree2dc45a1666844a310f39a2c390c990db43b49bba
parentb48d354600406d39b29fe7327b09a62d2584a83f

fix std.SegmentedList.Iterator.set


1 files changed, 2 insertions(+), 4 deletions(-)

std/segmented_list.zig+2-4
...@@ -300,10 +300,8 @@ pub fn SegmentedList(comptime T: type, comptime prealloc_item_count: usize) type...@@ -300,10 +300,8 @@ pub fn SegmentedList(comptime T: type, comptime prealloc_item_count: usize) type
300 }300 }
301301
302 pub fn set(it: &Iterator, index: usize) void {302 pub fn set(it: &Iterator, index: usize) void {
303 if (index < prealloc_item_count) {303 it.index = index;
304 it.index = index;304 if (index < prealloc_item_count) return;
305 return;
306 }
307 it.shelf_index = shelfIndex(index);305 it.shelf_index = shelfIndex(index);
308 it.box_index = boxIndex(index, it.shelf_index);306 it.box_index = boxIndex(index, it.shelf_index);
309 it.shelf_size = shelfSize(it.shelf_index);307 it.shelf_size = shelfSize(it.shelf_index);