diff options
author | Daniel Stone <daniel@fooishbar.org> | 2008-04-18 22:17:53 -0700 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2008-04-18 22:17:53 -0700 |
commit | 60ff56050b64183cb6e58f54223c8a3ddc2e704b (patch) | |
tree | 9d2cbfbae6977ee31063d42dab3b018447e3a778 /include | |
parent | ed9dabb47c467dbf49836b631d5d6bda4b0d98b0 (diff) |
Revert "Optimize dixLookupPrivate for repeated lookups of the same private."
The patch was wildly unsafe for SIGIO, and made everything full of
crashy crashy fail.
This reverts commit 9b30cc524867a0ad3d0d2227e167f4284830ab4e.
Diffstat (limited to 'include')
-rw-r--r-- | include/privates.h | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/include/privates.h b/include/privates.h index 093d17779..8d59b728f 100644 --- a/include/privates.h +++ b/include/privates.h @@ -46,20 +46,13 @@ dixAllocatePrivate(PrivateRec **privates, const DevPrivateKey key); static _X_INLINE pointer dixLookupPrivate(PrivateRec **privates, const DevPrivateKey key) { - PrivateRec *rec, *prev; + PrivateRec *rec = *privates; pointer *ptr; - for (rec = *privates, prev = NULL; rec; prev = rec, rec = rec->next) { - if (rec->key != key) - continue; - - if (prev) { - prev->next = rec->next; - rec->next = *privates; - *privates = rec; - } - - return rec->value; + while (rec) { + if (rec->key == key) + return rec->value; + rec = rec->next; } ptr = dixAllocatePrivate(privates, key); |