Skip to content

Commit

Permalink
* encoding.c (rb_enc_get_index): fixed indent.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Aug 6, 2009
1 parent efb9097 commit 87c1a07
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions encoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,31 +578,31 @@ rb_enc_get_index(VALUE obj)
VALUE tmp;

switch (BUILTIN_TYPE(obj)) {
as_default:
default:
case T_STRING:
case T_REGEXP:
i = ENCODING_GET_INLINED(obj);
if (i == ENCODING_INLINE_MAX) {
VALUE iv;

iv = rb_ivar_get(obj, rb_id_encoding());
i = NUM2INT(iv);
}
break;
case T_FILE:
tmp = rb_funcall(obj, rb_intern("internal_encoding"), 0, 0);
if (NIL_P(tmp)) obj = rb_funcall(obj, rb_intern("external_encoding"), 0, 0);
else obj = tmp;
if (NIL_P(obj)) break;
case T_DATA:
if (RDATA(obj)->dmark == enc_mark) {
i = enc_check_encoding(obj);
}
else {
goto as_default;
}
break;
as_default:
default:
case T_STRING:
case T_REGEXP:
i = ENCODING_GET_INLINED(obj);
if (i == ENCODING_INLINE_MAX) {
VALUE iv;

iv = rb_ivar_get(obj, rb_id_encoding());
i = NUM2INT(iv);
}
break;
case T_FILE:
tmp = rb_funcall(obj, rb_intern("internal_encoding"), 0, 0);
if (NIL_P(tmp)) obj = rb_funcall(obj, rb_intern("external_encoding"), 0, 0);
else obj = tmp;
if (NIL_P(obj)) break;
case T_DATA:
if (RDATA(obj)->dmark == enc_mark) {
i = enc_check_encoding(obj);
}
else {
goto as_default;
}
break;
}
return i;
}
Expand Down

0 comments on commit 87c1a07

Please sign in to comment.