From c1a8e8adac501cdead692f298f8dea0c20bafc76 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 6 Jan 2009 11:32:46 +0100 Subject: Simplify find_pipe_fns_by_context slightly --- source3/rpc_server/srv_pipe.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'source3/rpc_server/srv_pipe.c') diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c index 980630cb94..03d9c5b208 100644 --- a/source3/rpc_server/srv_pipe.c +++ b/source3/rpc_server/srv_pipe.c @@ -2201,21 +2201,17 @@ bool api_pipe_schannel_process(pipes_struct *p, prs_struct *rpc_in, uint32 *p_ss static PIPE_RPC_FNS* find_pipe_fns_by_context( PIPE_RPC_FNS *list, uint32 context_id ) { PIPE_RPC_FNS *fns = NULL; - PIPE_RPC_FNS *tmp = NULL; if ( !list ) { DEBUG(0,("find_pipe_fns_by_context: ERROR! No context list for pipe!\n")); return NULL; } - for (tmp=list; tmp; tmp=tmp->next ) { - if ( tmp->context_id == context_id ) - break; + for (fns=list; fns; fns=fns->next ) { + if ( fns->context_id == context_id ) + return fns; } - - fns = tmp; - - return fns; + return NULL; } /**************************************************************************** -- cgit