Skip to content

Commit c296b4c

Browse files
committed
Fix clippy lints
1 parent a859f0e commit c296b4c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/alpha.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,13 @@ pub fn unpremultiply_rgba16(in_place: &mut [u16], bit_depth: u32) {
227227
/// * `in_place`: Slice to where premultiply
228228
///
229229
pub fn premultiply_rgba_f32(in_place: &mut [f32]) {
230+
// Almost all loops are not auto-vectorised without doing anything dirty.
231+
// So everywhere is just added something beautiful.
230232
for chunk in in_place.chunks_exact_mut(4) {
231233
let a = chunk[3];
232-
chunk[0] = chunk[0] * a;
233-
chunk[1] = chunk[1] * a;
234-
chunk[2] = chunk[2] * a;
234+
chunk[0] *= a;
235+
chunk[1] *= a;
236+
chunk[2] *= a;
235237
chunk[3] = a;
236238
}
237239
}
@@ -253,6 +255,7 @@ pub fn unpremultiply_rgba_f32(in_place: &mut [f32]) {
253255
chunk[0] *= a_recip;
254256
chunk[1] *= a_recip;
255257
chunk[2] *= a_recip;
258+
chunk[3] = a;
256259
}
257260
}
258261
}

0 commit comments

Comments
 (0)