From: Todd C. Miller Date: Fri, 24 Aug 2007 00:28:57 +0000 (+0000) Subject: Back out he XOR swap trick, it is slower than a temp variable on X-Git-Tag: SUDO_1_7_0~409 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b63a4c9db0c22cb6f849646555466b8c83d8c31f;p=sudo Back out he XOR swap trick, it is slower than a temp variable on modern CPUs. --- diff --git a/parse.h b/parse.h index fe18e6e14..6d14ca3c8 100644 --- a/parse.h +++ b/parse.h @@ -146,13 +146,12 @@ struct defaults { /* * Append one queue (or single entry) to another using the * circular properties of the prev pointer to simplify the logic. - * We use XOR to swap the two prev pointers to avoid a temp variable. */ #define LIST_APPEND(h, e) do { \ + void *_tail = (e)->prev; \ (h)->prev->next = (e); \ - (long)(e)->prev ^= (long)(h)->prev; \ - (long)(h)->prev ^= (long)(e)->prev; \ - (long)(e)->prev ^= (long)(h)->prev; \ + (e)->prev = (h)->prev; \ + (h)->prev = _tail; \ } while (0) /*