diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-08 05:47:52 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-08 05:47:52 +0000 |
commit | 4a3970c2118e2c4a4558431886dde02cd7ad5b7e (patch) | |
tree | 1c66d5e8c62aefd892ea042ce0d87f8bafeb7bc4 /load.c | |
parent | d415f2abac2537cb9acb09def3646490d3d8518f (diff) | |
download | ruby-4a3970c2118e2c4a4558431886dde02cd7ad5b7e.tar.gz |
load.c: reorder conditions
* load.c (loaded_feature_path): reorder conditions so simple
comparision comes first.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'load.c')
-rw-r--r-- | load.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -297,10 +297,13 @@ loaded_feature_path(const char *name, long vlen, const char *feature, long len, 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. */ |