From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LL1mU-00033c-Et for qemu-devel@nongnu.org; Thu, 08 Jan 2009 15:47:06 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LL1mS-00033C-NQ for qemu-devel@nongnu.org; Thu, 08 Jan 2009 15:47:06 -0500 Received: from [199.232.76.173] (port=35683 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LL1mS-000337-GQ for qemu-devel@nongnu.org; Thu, 08 Jan 2009 15:47:04 -0500 Received: from acsinet12.oracle.com ([141.146.126.234]:52219) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LL1mR-00068Y-T4 for qemu-devel@nongnu.org; Thu, 08 Jan 2009 15:47:04 -0500 Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by acsinet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n08KkL0g023881 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 8 Jan 2009 20:46:22 GMT Received: from acsmt704.oracle.com (acsmt704.oracle.com [141.146.40.82]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n08KkmFR010012 for ; Thu, 8 Jan 2009 20:46:50 GMT Message-ID: <49666636.30801@oracle.com> Date: Thu, 08 Jan 2009 20:46:46 +0000 From: John Haxby MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1 of 3] Fix keymap handling for vnc console References: <4947CA2B.5030401@oracle.com> <4947CD50.8040806@oracle.com> <496661C6.3010507@codemonkey.ws> In-Reply-To: <496661C6.3010507@codemonkey.ws> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Anthony Liguori wrote: > John Haxby wrote: >> Fix keymap handling for international keyboards >> >> Signed-off-by: John Haxby >> [snip] > > Doing an in place sort of a literal array is probably not a great > idea. Why does the array need sorting? The indenting is really > screwed up here. > The size of the array is dramatically larger than it used to be -- over 1000 entries -- so a linear search over about 200 keysyms is, I thought, a little excessive for linear search and would take an appreciable time at start up. It also seems to me that more keysyms might need to be added in future: the choice was a one-off sort in the vnc_keysym.h definition which is prone to future editing errors or the one-off static sort in the code. I tossed the arguments back and forth with my stuffed penguin and came down in favour of sorting the array: it's a technique I've used before when I wanted robust code at the expense of a little initialisation overhead. Why do you think it's not a good idea? I'll happily revisit the notion. I have no idea why the indenting is screwed up -- it wasn't. I think the Christmas Elves must've got at it. Read and understood the remainder of the comments. I'll re-submit the patches tomorrow -- thanks for looking. jch