Commit 942d384831

Andrew Kelley <superjoe30@gmail.com>
2018-05-17 06:52:36
fix std.SegmentedList.Iterator.set
1 parent b48d354
Changed files (1)
std/segmented_list.zig
@@ -300,10 +300,8 @@ pub fn SegmentedList(comptime T: type, comptime prealloc_item_count: usize) type
             }
 
             pub fn set(it: &Iterator, index: usize) void {
-                if (index < prealloc_item_count) {
-                    it.index = index;
-                    return;
-                }
+                it.index = index;
+                if (index < prealloc_item_count) return;
                 it.shelf_index = shelfIndex(index);
                 it.box_index = boxIndex(index, it.shelf_index);
                 it.shelf_size = shelfSize(it.shelf_index);