summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-07-25 20:40:03 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-07-27 18:01:57 -0700
commit94fb2250b12fbaf840352b83dd9f832319c92b0f (patch)
tree68c34461935b4bce3ef1c939d510888aec805ba1
parent93ebeecdda61cc7121b5c095ed5db07ad0ca0f88 (diff)
downloadxorg-driver-xf86-input-mouse-94fb2250b12fbaf840352b83dd9f832319c92b0f.tar.gz
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 <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/mouse.c8
1 files 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