load.c: move loop invariant condition

* load.c (rb_feature_p): move this_feature_index condition which is
  loop invariant.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-03-08 23:54:41 +00:00
parent 8237581a2e
commit 1b7143309b

4
load.c
View File

@ -406,7 +406,8 @@ rb_feature_p(const char *feature, const char *ext, int rb, int expanded, const c
or ends in '/'. This includes both match forms above, as well or ends in '/'. This includes both match forms above, as well
as any distractors, so we may ignore all other entries in `features`. as any distractors, so we may ignore all other entries in `features`.
*/ */
for (i = 0; !NIL_P(this_feature_index); i++) { if (!NIL_P(this_feature_index)) {
for (i = 0; ; i++) {
VALUE entry; VALUE entry;
long index; long index;
if (RB_TYPE_P(this_feature_index, T_ARRAY)) { if (RB_TYPE_P(this_feature_index, T_ARRAY)) {
@ -442,6 +443,7 @@ rb_feature_p(const char *feature, const char *ext, int rb, int expanded, const c
return 'r'; return 'r';
} }
} }
}
loading_tbl = get_loading_table(); loading_tbl = get_loading_table();
if (loading_tbl) { if (loading_tbl) {