Subject: bin/30600: Change in code of bin/echo utility.
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <sergey@olontsev.biz>
List: netbsd-bugs
Date: 06/25/2005 18:41:00
>Number: 30600
>Category: bin
>Synopsis: Change in code of bin/echo utility.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sat Jun 25 18:41:00 +0000 2005
>Originator: Sergey Olontsev
>Release: none
>Organization:
none
>Environment:
none
>Description:
src/bin/echo/echo.c contains a part of code which to my opinion is not good, because contains "if" in "while". It is slow. So I send you my version of that part.
Old part:
while (*argv) {
(void)printf("%s", *argv);
if (*++argv)
(void)putchar(' ');
}
My version:
if (*argv)
(void)printf("%s", *argv++);
while (*argv)
(void)printf(" %s", *argv++);
I do understand that it is only small improvement but I hope it's just the beginning. :)
>How-To-Repeat:
>Fix: