From 94fb2250b12fbaf840352b83dd9f832319c92b0f Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 25 Jul 2011 20:40:03 -0700 Subject: No need to merge NULL options list with existing options Appending NULL to an existing options list simply walks the entire existing list before returning it unchanged, so if we aren't creating a new list to merge, don't bother merging it either. Signed-off-by: Alan Coopersmith Reviewed-by: Peter Hutterer --- src/mouse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mouse.c b/src/mouse.c index 238d7f7..d883b82 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -2431,13 +2431,13 @@ SetupMouse(InputInfoPtr pInfo) * for the new protocol. */ if (pMse->oldProtocolID != pMse->protocolID) { - pointer tmp = NULL; if ((pMse->protocolID >= 0) && (pMse->protocolID < PROT_NUMPROTOS) - && mouseProtocols[pMse->protocolID].defaults) - tmp = xf86OptionListCreate( + && mouseProtocols[pMse->protocolID].defaults) { + pointer tmp = xf86OptionListCreate( mouseProtocols[pMse->protocolID].defaults, -1, 0); - pInfo->options = xf86OptionListMerge(pInfo->options, tmp); + pInfo->options = xf86OptionListMerge(pInfo->options, tmp); + } /* * If baudrate is set write it back to the option * list so that the serial interface code can access -- cgit v1.2.1