diff options
author | José Fonseca <[email protected]> | 2009-07-01 10:03:59 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2009-07-01 10:03:59 +0100 |
commit | e8c4663c11cfbb80ed23b1581cf1f3ccaef28bce (patch) | |
tree | 6ef29bf4e735b70caa6ea34af988d5d74fa2b4d0 /src | |
parent | c72261f2a886e1f53025c2cf4b38b33ccfd62857 (diff) |
wgl: Optimize wglGetProcAddress.
Do linear search only if prefix matches.
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/state_trackers/wgl/shared/stw_getprocaddress.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/wgl/shared/stw_getprocaddress.c b/src/gallium/state_trackers/wgl/shared/stw_getprocaddress.c index 4070cbd5c00..8cacbb89266 100644 --- a/src/gallium/state_trackers/wgl/shared/stw_getprocaddress.c +++ b/src/gallium/state_trackers/wgl/shared/stw_getprocaddress.c @@ -65,13 +65,13 @@ stw_get_proc_address( { const struct stw_extension_entry *entry; - PROC p = (PROC) _glapi_get_proc_address( lpszProc ); - if (p) - return p; + if (lpszProc[0] == 'w' && lpszProc[1] == 'g' && lpszProc[2] == 'l') + for (entry = stw_extension_entries; entry->name; entry++) + if (strcmp( lpszProc, entry->name ) == 0) + return entry->proc; - for (entry = stw_extension_entries; entry->name; entry++) - if (strcmp( lpszProc, entry->name ) == 0) - return entry->proc; + if (lpszProc[0] == 'g' && lpszProc[1] == 'l') + return (PROC) _glapi_get_proc_address( lpszProc ); return NULL; } |