Skip to content

Commit 498b109

Browse files
committed
fix filling_set_at
1 parent 0a47e68 commit 498b109

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/bevy_render/src/render_resource/pipeline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ pub struct ComputePipelineDescriptor {
174174
// utility function to set a value at the specified index, extending with
175175
// a filler value if the index is out of bounds.
176176
fn filling_set_at<T: Clone>(vec: &mut Vec<T>, index: usize, filler: T, value: T) {
177-
let num_to_fill = index.saturating_sub(vec.len() - 1);
177+
let num_to_fill = (index + 1).saturating_sub(vec.len());
178178
vec.extend(iter::repeat_n(filler, num_to_fill));
179179
vec[index] = value;
180180
}

0 commit comments

Comments
 (0)