Skip to content

Commit dafbb72

Browse files
authored
Merge pull request #17 from defaultgnome/refactor/remove-unnecessary-splat-in-normalize
remove splat in normalize functions
2 parents 634ffd6 + cdbd2f2 commit dafbb72

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/root.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,13 +2021,13 @@ test "zmath.length3" {
20212021
}
20222022

20232023
pub inline fn normalize2(v: Vec) Vec {
2024-
return v * splat(F32x4, 1.0) / sqrt(dot2(v, v));
2024+
return v / sqrt(dot2(v, v));
20252025
}
20262026
pub inline fn normalize3(v: Vec) Vec {
2027-
return v * splat(F32x4, 1.0) / sqrt(dot3(v, v));
2027+
return v / sqrt(dot3(v, v));
20282028
}
20292029
pub inline fn normalize4(v: Vec) Vec {
2030-
return v * splat(F32x4, 1.0) / sqrt(dot4(v, v));
2030+
return v / sqrt(dot4(v, v));
20312031
}
20322032
test "zmath.normalize3" {
20332033
{

0 commit comments

Comments
 (0)