diff options
author | Benoit Daloze <eregontp@gmail.com> | 2023-01-06 15:07:39 +0100 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2023-01-11 13:41:41 +0100 |
commit | 6abe20e87b74a5a672dc59f72fa1f550ceab430c (patch) | |
tree | 85ea11a007e23327cfd83e0fb3f29f92767b8ee3 /encoding.c | |
parent | d831b1d5cef23593c94d80240b836fd2038aa685 (diff) | |
download | ruby-6abe20e87b74a5a672dc59f72fa1f550ceab430c.tar.gz |
Remove Encoding#replicate
Diffstat (limited to 'encoding.c')
-rw-r--r-- | encoding.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/encoding.c b/encoding.c index 39a47f2b8c..469ec47db5 100644 --- a/encoding.c +++ b/encoding.c @@ -505,37 +505,6 @@ enc_replicate(struct enc_table *enc_table, const char *name, rb_encoding *encodi return idx; } -int -rb_enc_replicate(const char *name, rb_encoding *encoding) -{ - int r; - - GLOBAL_ENC_TABLE_EVAL(enc_table, - r = enc_replicate(enc_table, name, encoding)); - - return r; -} - -/* - * call-seq: - * enc.replicate(name) -> encoding - * - * Returns a replicated encoding of _enc_ whose name is _name_. - * The new encoding should have the same byte structure of _enc_. - * If _name_ is used by another encoding, raise ArgumentError. - * - */ -static VALUE -enc_replicate_m(VALUE encoding, VALUE name) -{ - int idx; - rb_warn_deprecated_to_remove("3.3", "Encoding#replicate", "the original encoding"); - - idx = rb_enc_replicate(name_for_encoding(&name), rb_to_encoding(encoding)); - RB_GC_GUARD(name); - return rb_enc_from_encoding_index(idx); -} - static int enc_replicate_with_index(struct enc_table *enc_table, const char *name, rb_encoding *origenc, int idx) { @@ -1914,7 +1883,6 @@ Init_Encoding(void) rb_define_method(rb_cEncoding, "names", enc_names, 0); rb_define_method(rb_cEncoding, "dummy?", enc_dummy_p, 0); rb_define_method(rb_cEncoding, "ascii_compatible?", enc_ascii_compatible_p, 0); - rb_define_method(rb_cEncoding, "replicate", enc_replicate_m, 1); rb_define_singleton_method(rb_cEncoding, "list", enc_list, 0); rb_define_singleton_method(rb_cEncoding, "name_list", rb_enc_name_list, 0); rb_define_singleton_method(rb_cEncoding, "aliases", rb_enc_aliases, 0); |