OSDN Git Service

Fix a weird bug in selecting initial colors by wrong order of loads/stores.
authorRudolf Polzer <divverent@xonotic.org>
Thu, 31 Oct 2013 14:39:08 +0000 (15:39 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 31 Oct 2013 14:39:08 +0000 (15:39 +0100)
s2tc_algorithm.cpp

index 26d8db0..e9114d7 100644 (file)
@@ -405,10 +405,9 @@ namespace
                                        bestj = j;
                                }
                        }
-               if(besti != 0)
-                       c[0] = c[besti];
-               if(bestj != 1)
-                       c[1] = c[bestj];
+               T c0 = c[besti];
+               c[1] = c[bestj];
+               c[0] = c0;
        }
        template <class T, class F>
        inline void reduce_colors_inplace_2fixpoints(T *c, int n, int m, F dist, const T &fix0, const T &fix1)