glfw: update to new for loop syntax (#711)

This commit is contained in:
Casey Banner 2023-03-01 20:32:21 -05:00 committed by GitHub
parent 5ed584a481
commit 5020979355

View file

@ -488,7 +488,7 @@ pub inline fn setIcon(self: Window, allocator: mem.Allocator, images: ?[]Image)
if (images) |im| {
const tmp = try allocator.alloc(c.GLFWimage, im.len);
defer allocator.free(tmp);
for (im) |img, index| tmp[index] = img.toC();
for (im, 0..) |img, index| tmp[index] = img.toC();
c.glfwSetWindowIcon(self.handle, @intCast(c_int, im.len), &tmp[0]);
} else c.glfwSetWindowIcon(self.handle, 0, null);
}