Replace XOR swapping by default ("naive", with extra var) one.
Ref: http://en.wikipedia.org/wiki/XOR_swap_algorithm, modern compilers/CPUs are much more efficient with "naive" algo than XOR one. Doubled check, for me in an optimized build, XOR is several times slower than naive algo.
This commit is contained in:
@@ -59,11 +59,9 @@ static const unsigned int _ehash_hashsizes[] = {
|
||||
#endif
|
||||
|
||||
/* ensure v0 is smaller */
|
||||
#define EDGE_ORD(v0, v1) \
|
||||
if (v0 > v1) { \
|
||||
v0 ^= v1; \
|
||||
v1 ^= v0; \
|
||||
v0 ^= v1; \
|
||||
#define EDGE_ORD(v0, v1) \
|
||||
if (v0 > v1) { \
|
||||
SWAP(unsigned int, v0, v1); \
|
||||
} (void)0
|
||||
|
||||
/***/
|
||||
|
||||
@@ -90,11 +90,9 @@ static GSet *erot_gset_new(void)
|
||||
}
|
||||
|
||||
/* ensure v0 is smaller */
|
||||
#define EDGE_ORD(v0, v1) \
|
||||
if (v0 > v1) { \
|
||||
v0 ^= v1; \
|
||||
v1 ^= v0; \
|
||||
v0 ^= v1; \
|
||||
#define EDGE_ORD(v0, v1) \
|
||||
if (v0 > v1) { \
|
||||
SWAP(int, v0, v1); \
|
||||
} (void)0
|
||||
|
||||
static void erot_state_ex(const BMEdge *e, int v_index[2], int f_index[2])
|
||||
|
||||
Reference in New Issue
Block a user