diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-01 02:50:59 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-11-01 02:50:59 +0000 |
commit | 9f37449f176d8943b765fc65c1adc5290e0f72ac (patch) | |
tree | 6ae308aaf787375933c3f0c1b276c464c038152f /template | |
parent | 513d8b349f3e37c3fa43a11148a68a2e14836fcb (diff) | |
download | ruby-9f37449f176d8943b765fc65c1adc5290e0f72ac.tar.gz |
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
Diffstat (limited to 'template')
-rw-r--r-- | template/ruby-runner.c.in | 6 |
1 files changed, 4 insertions, 2 deletions
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); |