From: Fabrice Bellard <fabrice@bellard.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] FDC: simplify code [v3]
Date: Wed, 09 Apr 2008 00:10:54 +0200 [thread overview]
Message-ID: <47FBED6E.4080503@bellard.org> (raw)
In-Reply-To: <47FA79D9.4050104@reactos.org>
Hervé Poussineau wrote:
> Hi,
>
> Attached patch prevents duplication of quite similar code in fdc.c, and
> so, removes 300 lines and 8KB of code.
> It first extracts implementation of FDC commands to separate methods,
> and then uses a table to know which method to execute instead of a big
> switch.
>
> This version is quite similar to v1 (I removed the lookup table added in
> v2), except that I tried to minimize the time spent to search in the
> command table by putting most used commands at the beginning. I don't
> have any statistics to proove the order, that's only observation and
> guess...
A lookup table could be generated dynamically from your table by using a
few lines of code... You current solution is very slow, but you are
saved by the fact that the FDC speed is not critical anyway.
Fabrice.
next prev parent reply other threads:[~2008-04-08 22:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-07 19:45 [Qemu-devel] [PATCH] FDC: simplify code [v3] Hervé Poussineau
2008-04-08 22:10 ` Fabrice Bellard [this message]
2008-04-09 6:11 ` Hervé Poussineau
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=47FBED6E.4080503@bellard.org \
--to=fabrice@bellard.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).