зеркало из https://github.com/github/ruby.git
* encoding.c (rb_enc_get_index): fixed indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
efb9097352
Коммит
87c1a07d6a
48
encoding.c
48
encoding.c
|
@ -578,31 +578,31 @@ rb_enc_get_index(VALUE obj)
|
||||||
VALUE tmp;
|
VALUE tmp;
|
||||||
|
|
||||||
switch (BUILTIN_TYPE(obj)) {
|
switch (BUILTIN_TYPE(obj)) {
|
||||||
as_default:
|
as_default:
|
||||||
default:
|
default:
|
||||||
case T_STRING:
|
case T_STRING:
|
||||||
case T_REGEXP:
|
case T_REGEXP:
|
||||||
i = ENCODING_GET_INLINED(obj);
|
i = ENCODING_GET_INLINED(obj);
|
||||||
if (i == ENCODING_INLINE_MAX) {
|
if (i == ENCODING_INLINE_MAX) {
|
||||||
VALUE iv;
|
VALUE iv;
|
||||||
|
|
||||||
iv = rb_ivar_get(obj, rb_id_encoding());
|
iv = rb_ivar_get(obj, rb_id_encoding());
|
||||||
i = NUM2INT(iv);
|
i = NUM2INT(iv);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case T_FILE:
|
case T_FILE:
|
||||||
tmp = rb_funcall(obj, rb_intern("internal_encoding"), 0, 0);
|
tmp = rb_funcall(obj, rb_intern("internal_encoding"), 0, 0);
|
||||||
if (NIL_P(tmp)) obj = rb_funcall(obj, rb_intern("external_encoding"), 0, 0);
|
if (NIL_P(tmp)) obj = rb_funcall(obj, rb_intern("external_encoding"), 0, 0);
|
||||||
else obj = tmp;
|
else obj = tmp;
|
||||||
if (NIL_P(obj)) break;
|
if (NIL_P(obj)) break;
|
||||||
case T_DATA:
|
case T_DATA:
|
||||||
if (RDATA(obj)->dmark == enc_mark) {
|
if (RDATA(obj)->dmark == enc_mark) {
|
||||||
i = enc_check_encoding(obj);
|
i = enc_check_encoding(obj);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
goto as_default;
|
goto as_default;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче