|
From: | Anthony Liguori |
Subject: | Re: [Qemu-devel] [PATCH 1 of 3] Fix keymap handling for vnc console |
Date: | Thu, 08 Jan 2009 15:06:26 -0600 |
User-agent: | Thunderbird 2.0.0.19 (X11/20090105) |
John Haxby wrote:
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.
Since it's a literal array, it's sort of weird to sort it at run time. Why not just pre-sort it in the code? Heck, just write a simple program to re-output the array even in a sorted form.
If you did that, the binary search thing would be fine. It's the sorting of the literal array that makes me nervous.
Regards, Anthony Liguori
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
[Prev in Thread] | Current Thread | [Next in Thread] |