summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Altman <jaltman@secure-endpoints.com>2007-09-27 03:44:29 +0000
committerJeffrey Altman <jaltman@secure-endpoints.com>2007-09-27 03:44:29 +0000
commitbe2c77c88a86c87b34add694e85b660fa7397f35 (patch)
treed9d82088186e43267ec88470620cdb6316361dcf
parentb3e642e821a09e9cea46c604d0b5450ffbafcfbf (diff)
downloadkrb5-be2c77c88a86c87b34add694e85b660fa7397f35.tar.gz
krb5-be2c77c88a86c87b34add694e85b660fa7397f35.tar.xz
krb5-be2c77c88a86c87b34add694e85b660fa7397f35.zip
NIM: BUG: LIB: optimize khui_find_action()
In Network Identity Manager, when locating the action object corresponding to an action identifier using khui_find_action(), don't search through the list of standard actions if we already know that the object we are searching for is a custom action. ticket: new component: windows git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19984 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/windows/identity/uilib/action.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/windows/identity/uilib/action.c b/src/windows/identity/uilib/action.c
index a47683171b..04fb52a849 100644
--- a/src/windows/identity/uilib/action.c
+++ b/src/windows/identity/uilib/action.c
@@ -796,16 +796,18 @@ khui_find_menu(khm_int32 id) {
KHMEXP khui_action * KHMAPI
khui_find_action(khm_int32 id) {
- khui_action * act;
+ khui_action * act = NULL;
int i;
- act = khui_actions;
- for(i=0;i<khui_n_actions;i++) {
- if(act[i].cmd == id)
- return &act[i];
- }
+ if (id < KHUI_USERACTION_BASE) {
+ act = khui_actions;
+ for(i=0;i<khui_n_actions;i++) {
+ if(act[i].cmd == id)
+ return &act[i];
+ }
- act = NULL;
+ return NULL;
+ }
EnterCriticalSection(&cs_actions);
if (id >= KHUI_USERACTION_BASE &&