зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
d415f2abac
Коммит
4a3970c211
9
load.c
9
load.c
|
@ -297,9 +297,12 @@ 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] != '/') {
|
||||
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
|
||||
|
|
Загрузка…
Ссылка в новой задаче