Remove redundant sorting function

This commit is contained in:
Marc Gilleron 2021-05-23 20:24:33 +01:00
parent 16f209780c
commit c82aab9f74
2 changed files with 4 additions and 13 deletions

View File

@ -20,7 +20,6 @@
template <typename T>
inline T interpolate(const T v0, const T v1, const T v2, const T v3, const T v4, const T v5, const T v6, const T v7,
Vector3 position) {
const float one_min_x = 1.f - position.x;
const float one_min_y = 1.f - position.y;
const float one_min_z = 1.f - position.z;
@ -91,15 +90,6 @@ inline T squared(const T x) {
return x * x;
}
template <typename T>
inline void sort_min_max(T &a, T &b) {
if (a > b) {
T temp = a;
a = b;
b = temp;
}
}
// TODO Rename udiv => floordiv
// Performs euclidean division, aka floored division.

View File

@ -1,6 +1,7 @@
#ifndef VOXEL_VECTOR3I_H
#define VOXEL_VECTOR3I_H
#include "../funcs.h"
#include "funcs.h"
#include <core/hashfuncs.h>
#include <core/math/vector3.h>
@ -144,9 +145,9 @@ struct Vector3i {
}
static void sort_min_max(Vector3i &a, Vector3i &b) {
::sort_min_max(a.x, b.x);
::sort_min_max(a.y, b.y);
::sort_min_max(a.z, b.z);
::sort(a.x, b.x);
::sort(a.y, b.y);
::sort(a.z, b.z);
}
inline Vector3i udiv(const Vector3i d) const {