From 9f37449f176d8943b765fc65c1adc5290e0f72ac Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 1 Nov 2015 02:50:59 +0000 Subject: ruby-runner.c.in: trivial optimization * template/ruby-runner.c.in (main): trivial optimization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- template/ruby-runner.c.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'template') diff --git a/template/ruby-runner.c.in b/template/ruby-runner.c.in index c4ee2f1ee4..75be21573f 100644 --- a/template/ruby-runner.c.in +++ b/template/ruby-runner.c.in @@ -15,10 +15,12 @@ main(int argc, char **argv) { static const char builddir[] = BUILDDIR; const char *libpath = getenv(LIBPATHENV); + char c = 0; + if (libpath) { - while (*libpath == PATH_SEP) ++libpath; + while ((c = *libpath) == PATH_SEP) ++libpath; } - if (libpath && *libpath) { + if (c) { size_t n = strlen(libpath); char *e = malloc(sizeof(builddir)+n+1); memcpy(e, builddir, sizeof(builddir)-1); -- cgit v1.2.3