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

ruby-changes:27585

From: nobu <ko1@a...>
Date: Fri, 8 Mar 2013 14:48:01 +0900 (JST)
Subject: [ruby-changes:27585] nobu:r39637 (trunk): load.c: reorder conditions

nobu	2013-03-08 14:47:52 +0900 (Fri, 08 Mar 2013)

  New Revision: 39637

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

  Log:
    load.c: reorder conditions
    
    * load.c (loaded_feature_path): reorder conditions so simple
      comparision comes first.

  Modified files:
    trunk/load.c

Index: load.c
===================================================================
--- load.c	(revision 39636)
+++ load.c	(revision 39637)
@@ -297,10 +297,13 @@ loaded_feature_path(const char *name, lo https://github.com/ruby/ruby/blob/trunk/load.c#L297
 	    return 0;
 	plen = e - name - len - 1;
     }
-    if (type == 's' && !IS_DLEXT(&name[plen+len+1])
-     || type == 'r' && !IS_RBEXT(&name[plen+len+1])
-     || name[plen] != '/') {
-       return 0;
+    if (name[plen] != '/') {
+	return 0;
+    }
+    if (type == 's' ? !IS_DLEXT(&name[plen+len+1]) :
+	type == 'r' ? !IS_RBEXT(&name[plen+len+1]) :
+	0) {
+	return 0;
     }
     /* Now name == "#{prefix}/#{feature}#{ext}" where ext is acceptable
        (possibly empty) and prefix is some string of length plen. */

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

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