[前][次][番号順一覧][スレッド一覧]

ruby-changes:40339

From: nobu <ko1@a...>
Date: Sun, 1 Nov 2015 11:51:18 +0900 (JST)
Subject: [ruby-changes:40339] nobu:r52420 (trunk): ruby-runner.c.in: trivial optimization

nobu	2015-11-01 11:50:59 +0900 (Sun, 01 Nov 2015)

  New Revision: 52420

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52420

  Log:
    ruby-runner.c.in: trivial optimization
    
    * template/ruby-runner.c.in (main): trivial optimization.

  Modified files:
    trunk/template/ruby-runner.c.in
Index: template/ruby-runner.c.in
===================================================================
--- template/ruby-runner.c.in	(revision 52419)
+++ template/ruby-runner.c.in	(revision 52420)
@@ -15,10 +15,12 @@ main(int argc, char **argv) https://github.com/ruby/ruby/blob/trunk/template/ruby-runner.c.in#L15
 {
     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);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]