From: Kevin Buettner <kevinb@redhat.com>
To: rda@sources.redhat.com
Subject: [commit] Minor lib/gdbserv-output optimization
Date: Sat, 07 Nov 2009 05:31:00 -0000 [thread overview]
Message-ID: <20091106223127.6b2e4153@redhat.com> (raw)
While comparing Red Hat's internal RDA sources to the public ones, I came
across this old change by Michael Snyder.
Committed.
Kevin
2009-11-06 Kevin Buettner <kevinb@redhat.com>
From Michael Snyder (circa 2004):
* lib/gdbserv-output.c (gdbserv_output_string_as_bytes):
Pull strlen out of loop for optimization.
(gdbserv_output_string): Ditto.
Index: lib/gdbserv-output.c
===================================================================
RCS file: /cvs/src/src/rda/lib/gdbserv-output.c,v
retrieving revision 1.2
diff -u -p -r1.2 gdbserv-output.c
--- lib/gdbserv-output.c 24 Sep 2004 21:18:59 -0000 1.2
+++ lib/gdbserv-output.c 7 Nov 2009 05:19:35 -0000
@@ -57,7 +57,9 @@ void
gdbserv_output_string_as_bytes (struct gdbserv *gdbserv, const char *packet)
{
int i;
- for (i = 0; i < strlen (packet); i++)
+ int len = strlen (packet);
+
+ for (i = 0; i < len; i++)
{
gdbserv_output_byte (gdbserv, packet[i]);
}
@@ -67,7 +69,9 @@ void
gdbserv_output_string (struct gdbserv *gdbserv, const char *packet)
{
int i;
- for (i = 0; i < strlen (packet); i++)
+ int len = strlen (packet);
+
+ for (i = 0; i < len; i++)
gdbserv_output_char (gdbserv, packet[i]);
}
reply other threads:[~2009-11-07 5:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20091106223127.6b2e4153@redhat.com \
--to=kevinb@redhat.com \
--cc=rda@sources.redhat.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).