aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_sort_s_t.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-27 16:44:30 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-27 16:44:30 +0100
commit44d5f7f4da8465f4829de1232e4cf2c6c2bf76bc (patch)
tree0926de3e4bebc9015b7806bcdeb99818d84af9ae /src/ft_sort_s_t.c
parentProblem (diff)
download42-cub3d-44d5f7f4da8465f4829de1232e4cf2c6c2bf76bc.tar.gz
42-cub3d-44d5f7f4da8465f4829de1232e4cf2c6c2bf76bc.tar.bz2
42-cub3d-44d5f7f4da8465f4829de1232e4cf2c6c2bf76bc.tar.xz
42-cub3d-44d5f7f4da8465f4829de1232e4cf2c6c2bf76bc.tar.zst
42-cub3d-44d5f7f4da8465f4829de1232e4cf2c6c2bf76bc.zip
Segv fix
Diffstat (limited to 'src/ft_sort_s_t.c')
-rw-r--r--src/ft_sort_s_t.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/ft_sort_s_t.c b/src/ft_sort_s_t.c
index 9cbde8b..31ae237 100644
--- a/src/ft_sort_s_t.c
+++ b/src/ft_sort_s_t.c
@@ -34,19 +34,6 @@ float
}
static void
- ft_init_st(int32_t *st_o)
-{
- int8_t i;
-
- i = 0;
- while (i < FT_TOTAL_SPRT)
- {
- st_o[i] = i;
- i++;
- }
-}
-
-static void
ft_swap_them(int16_t i, float **dist_tab)
{
float tmp_i[4096];
@@ -63,11 +50,10 @@ void
int32_t tmp;
i = -1;
- ft_init_st(cl->mlist.st_o);
while (++i < FT_TOTAL_SPRT)
{
- if (i < FT_TOTAL_SPRT && dist_tab[i][0]
- && dist_tab[i][0] < dist_tab[i + 1][0])
+ cl->mlist.st_o[i] = i;
+ if (dist_tab[i][0] < dist_tab[i + 1][0])
{
tmp = cl->mlist.st_o[i];
cl->mlist.st_o[i] = cl->mlist.st_o[i + 1];