All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1 of 3] Fix keymap handling for vnc console
Date: Thu, 08 Jan 2009 15:06:26 -0600	[thread overview]
Message-ID: <49666AD2.80001@codemonkey.ws> (raw)
In-Reply-To: <49666636.30801@oracle.com>

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
>
>
>

  reply	other threads:[~2009-01-08 21:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-16 15:32 [Qemu-devel] [PATCH 0 of 3] Fix keymap handling for vnc console John Haxby
2008-12-16 15:46 ` [Qemu-devel] [PATCH 1 " John Haxby
2009-01-08 20:27   ` Anthony Liguori
2009-01-08 20:46     ` John Haxby
2009-01-08 21:06       ` Anthony Liguori [this message]
2008-12-16 15:48 ` [Qemu-devel] [PATCH 2 " John Haxby
2008-12-16 15:49 ` [Qemu-devel] [PATCH 3 " John Haxby
2009-01-07 15:12 ` [Qemu-devel] [PATCH 0 " John Haxby
2009-01-08 20:17   ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49666AD2.80001@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.