Commit graph

1198 commits

Author SHA1 Message Date
usa
1816ba0922 merge revision(s) 60000,60001,60002: [Backport #13925]
dup String#partition return value

	* string.c (rb_str_partition): return duplicated receiver, when no
	  splits.  [ruby-core:82911] [Bug#13925]

	Author:    Seiei Miyagi <hanachin@gmail.com>

	dup String#rpartition return value

	* string.c (rb_str_rpartition): return duplicated receiver, when
	  no splits.  [ruby-core:82911] [Bug#13925]

	Author:    Seiei Miyagi <hanachin@gmail.com>

	dup String#split return value

	* string.c (rb_str_split): return duplicated receiver, when no
	  splits.  patched by tompng (tomoya ishida) in [ruby-core:82911],
	  and the test case by Seiei Miyagi <hanachin@gmail.com>.
	  [Bug#13925] [Fix GH-1705]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@62818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-18 15:00:46 +00:00
usa
3f59416771 merge revision(s) 60066: [Backport #13952]
string.c: fix ASCII-only on succ

	* string.c (str_succ): clear coderange cache when no alpha-numeric
	  character case, carried part may become ASCII-only.
	  [ruby-core:83062] [Bug #13952]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@62139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-31 13:30:15 +00:00
usa
a852edd817 merge revision(s) 60060: [Backport #13950]
string.c: ASCII-incompatible is not ASCII only

	* string.c (tr_trans): ASCII-incompatible encoding strings cannot
	  be ASCII-only even if valid.  [ruby-core:83056] [Bug #13950]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@62137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-31 13:26:35 +00:00
usa
305b200d10 merge revision(s) 57536: [Backport #13192]
doc: Add example for Symbol#to_s

	* string.c: add example for Symbol#to_s.

	The docs for Symbol#to_s only include an example for
	Symbol#id2name, but not for #to_s which is an alias;
	the docs should include examples for both methods.

	From: Marcus Stollsteimer <sto.mar@web.de>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@62125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-31 10:58:21 +00:00
usa
04667398c9 merge revision(s) 59763: [Backport #13874]
string.c: fix false coderange

	* string.c (rb_enc_str_scrub): enc can differ from the actual
	  encoding of the string, the cached coderange is useless then.
	  [ruby-core:82674] [Bug #13874]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@59883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-14 04:31:25 +00:00
usa
37cce5ae90 merge revision(s) 59002: [Backport #13621]
string.c: docs for String#split

	* string.c: [DOC] clarify docs for String#split when called
	  with limit and capture groups.
	  Reported by Cichol Tsai.  [ruby-core:81505] [Bug #13621]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@59227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-30 11:32:44 +00:00
nagachika
d8a1986a05 merge revision(s) 57374: [Backport #13135]
string.c: rindex(//) should set $~.

	This seems a bug introduced by r520 (1.4.0).  [ruby-core:79110] [Bug #13135]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 16:41:00 +00:00
nagachika
39ee1e953f merge revision(s) 57302,57303,57304: [Backport #13119]
string.c: block for scrub with ASCII-incompatible

	* string.c (rb_enc_str_scrub): honor the given block with
	  ASCII-incompatible encoding.  [ruby-core:79039] [Bug #13120]
	string.c: yield invalid part

	* string.c (rb_enc_str_scrub): yield the invalid part only with
	  ASCII-incompatible.  [ruby-core:79039] [Bug #13120]
	string.c: replacement and block

	* string.c (rb_enc_str_scrub): only one of replacement and block
	  is allowed.  [ruby-core:79038] [Bug #13119]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@58175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-27 16:37:09 +00:00
nagachika
6f122a4f10 merge revision(s) 55547,55551,55552,55555,55557,55559,55575,55691,55568: [Backport #12536]
* string.c: Fix memory corruptions when using UTF-16/32 strings.
	  [Bug #12536] [ruby-dev:49699]

	* string.c (TERM_LEN_MAX): Macro for the longest TERM_FILL length,
	  the same as largest value of rb_enc_mbminlen(enc) among encodings.

	* string.c (str_new, rb_str_buf_new, str_shared_replace): Allocate
	  +TERM_LEN_MAX bytes instead of +1. This change may increase memory
	  usage.

	* string.c (rb_str_new_with_class): Use TERM_LEN of the "obj".

	* string.c (rb_str_plus, rb_str_justify): Use str_new0 which is aware
	  of termlen.

	* string.c (str_shared_replace): Copy +termlen bytes instead of +1.

	* string.c (rb_str_times): termlen should not be included in capa.

	* string.c (RESIZE_CAPA_TERM): When using RSTRING_EMBED_LEN_MAX,
	  termlen should be counted with it because embedded strings are
	  also processed by TERM_FILL.

	* string.c (rb_str_capacity, str_shared_replace, str_buf_cat): ditto.

	* string.c (rb_str_drop_bytes, rb_str_setbyte, str_byte_substr): ditto.

	* string.c (rb_str_subseq, str_substr): When RSTRING_EMBED_LEN_MAX
	  is used, TERM_LEN(str) should be considered with it because
	  embedded strings are also processed by TERM_FILL.
	  Additional fix for [Bug #12536] [ruby-dev:49699].
	  Additional fix for [Bug #12536] [ruby-dev:49699].

	* string.c (rb_usascii_str_new, rb_utf8_str_new): Specify termlen
	  which is apparently 1 for the encodings.

	* string.c (str_new0_cstr): New static function to create a String
	  object from a C string with specifying termlen.

	* string.c (rb_usascii_str_new_cstr, rb_utf8_str_new_cstr): Specify
	  termlen by using new str_new0_cstr().

	* string.c (str_new_static): Specify termlen from the given encoding
	  when creating a new String object is needed.

	* string.c (rb_tainted_str_new_with_enc): New function to create a
	  tainted String object with the given encoding. This means that
	  the termlen is correctly specified. Curretly static function.
	  The function name might be renamed to rb_tainted_enc_str_new
	  or rb_enc_tainted_str_new.

	* string.c (rb_external_str_new_with_enc): Use encoding by using the
	  above rb_tainted_str_new_with_enc().

	* string.c (str_fill_term): When termlen increases, re-allocation
	  of memory for termlen should always be needed.
	  In this fix, if possible, decrease capa instead of realloc.
	  [Bug #12536] [ruby-dev:49699]

	* string.c: Partially reverts r55547 and r55555.
	  ChangeLog about the reverted changes are also deleted in this file.
	  [Bug #12536] [ruby-dev:49699] [ruby-dev:49702]

	* string.c (rb_str_change_terminator_length): New function to change
	  termlen and resize heap for the terminator. This is split from
	  rb_str_fill_terminator (str_fill_term) because filling terminator
	  and changing terminator length are different things. [Bug #12536]

	* internal.h: declaration for rb_str_change_terminator_length.

	* string.c (str_fill_term): Simplify only to zero-fill the terminator.
	  For non-shared strings, it assumes that (capa + termlen) bytes of
	  heap is allocated. This partially reverts r55557.

	* encoding.c (rb_enc_associate_index): rb_str_change_terminator_length
	  is used, and it should be called whenever the termlen is changed.

	* string.c (str_capacity): New static function to return capacity
	  of a string with the given termlen, because the termlen may
	  sometimes be different from TERM_LEN(str) especially during
	  changing termlen or filling terminator with specific termlen.

	* string.c (rb_str_capacity): Use str_capacity.

	* string.c (str_buf_cat): Fix capa size for embed string.
	  Fix bug in r55547. [Bug #12536]

	* string.c: Specify termlen as far as possible.
	  the termlen is correctly specified. Currently static function.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@55988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-22 18:18:50 +00:00
nagachika
4c3d49e917 merge revision(s) 55729: [Backport #12611]
* vm.c (vm_set_main_stack): remove unnecessary check.  toplevel
	  binding must be initialized.  [Bug #12611] (N1)

	* win32/win32.c (w32_symlink): fix return type.  [Bug #12611] (N3)

	* string.c (rb_str_split_m): simplify the condition.
	  [Bug #12611](N4)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@55959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-18 14:17:22 +00:00
nagachika
9b71251e1e merge revision(s) 55181: [Backport #12431]
* transcode.c (str_transcode0): scrub in the given encoding when
	  the source encoding is given, not in the encoding of the
	  receiver.  [ruby-core:75732] [Bug #12431]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@55905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-15 19:02:10 +00:00
nagachika
840a4573af merge revision(s) 55427: [Backport #12503]
* string.c (tr_trans): consider terminator length and fix heap
	  overflow.  reported by Guido Vranken <guido AT guidovranken.nl>.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@55561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-01 19:09:29 +00:00
nagachika
e117afcb70 merge revision(s) 55054: [Backport #12390]
* string.c (rb_str_modify_expand): check integer overflow.
	  [ruby-core:75592] [Bug #12390]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@55426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-15 16:05:04 +00:00
naruse
a2ed2d20cb merge revision(s) 53724: [Backport #11946]
* string.c (str_new_frozen): if the given string is embeddedable
	  but not embedded, embed a new copied string. [Bug #11946]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@54416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-29 16:30:10 +00:00
naruse
9d502cf9a4 merge revision(s) 54210: [Backport #12204]
* string.c (enc_succ_alnum_char): try to skip an invalid character
	  gap between GREEK CAPITAL RHO and SIGMA.
	  [ruby-core:74478] [Bug #12204]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@54384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-03-29 08:00:06 +00:00
yui-knk
adc0898538 * string.c: Fix document. Default value of the first
argument of `String#split` is not `$;` but `nil`.
  When `nil` is passed as first argument, `$;` is used.
  [ci skip] [Bug #11729] [ruby-dev:49378]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-23 03:02:07 +00:00
nobu
9da8a29760 string.c: no exception on dummy encoding
* string.c (str_compat_and_valid): as scrub does nothing for dummy
  encoding string now, incompatible encoding is not a matter.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-22 06:21:14 +00:00
nobu
61c19c9d43 string.c: infection
* string.c (rb_str_scrub): the result should be infected by the
  original string.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-17 05:16:27 +00:00
nobu
365fae4dd9 string.c: radix indicators [ci skip]
* string.c (rb_str_oct): [DOC] mention radix indicators.
  [ruby-core:71310] [Bug #11648]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-15 04:49:59 +00:00
hsbt
52cd994814 * enum.c: fix a typo in documentation.
[ci skip][fix GH-1140] Patch by @jutaz
* io.c: ditto.
* iseq.c: ditto.
* numeric.c: ditto.
* process.c: ditto.
* string.c: ditto.
* vm_trace.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-14 02:52:14 +00:00
naruse
e3ab670a71 * object.c (rb_inspect): dump inspected result with rb_str_escape()
instead of raising Encoding::CompatibilityError. [Feature #11801]

* string.c (rb_str_escape): added to dump given string like
  rb_str_inspect without quotes and always dump in US-ASCII
  like rb_str_dump.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-10 18:57:08 +00:00
nobu
cf183a58de string.c: use rb_id_encoding
* string.c (rb_str_init): rb_id_encoding() returns same ID with
  caching.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 23:41:27 +00:00
usa
4466d4baa9 * string.c (rb_str_init): now accepts new option parameter `encoding'.
[Feature #11785]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 16:48:52 +00:00
duerst
d9c6135c5b string.c: removed unused variable
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 08:36:43 +00:00
ko1
6d8bf54c44 * string.c: introduce String#+@ and String#-@ to control
String mutability.
  [Feature #11782]




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 15:10:00 +00:00
nobu
cae3905e89 string.c: should not taint fstring
* string.c (rb_obj_as_string): fstring should not be infected.
  re-apply r52872 and fix a typo.
  TODO: other frozen strings also may not be.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-04 07:48:22 +00:00
naruse
f2532ab8ca Revert r52872 "string.c: should not taint fstring"
This reverts commit b887c7c20a.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-04 04:10:00 +00:00
nobu
b887c7c20a string.c: should not taint fstring
* string.c (rb_obj_as_string): fstring should not be infected.
  TODO: other frozen strings also may not be.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-03 07:02:19 +00:00
nobu
0167fc15fb string.c: adjust argument qualifier
* string.c (str_make_independent_expand): adjust argument
  qualifier to get rid of a VC bug.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-02 00:45:32 +00:00
nobu
d58f17f37d string.c: no frozen error at cstr
* string.c (rb_string_value_cstr): should not raise on frozen
  string.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-01 08:13:43 +00:00
normal
f9806460e9 string.c: use predefined IDs for minor bloat reduction
* string.c (id_to_s): remove redundant variable
  (rb_obj_as_string): trade id_to_s for idTo_s
  (rb_str_equal): replace rb_intern(...) with pre-defined ID
  (rb_str_cmp_m): ditto
  (rb_str_match): ditto
  (str_upto_each): ditto
  (rb_str_sum): ditto
  (Init_String): remove id_to_s initialization

This leads to a minor size reduction on my x86 (32-bit) system:

   text	   data	    bss	    dec	    hex	filename
 129373	      8	     32	 129413	  1f985	string.o-orig
 129082	      8	      8	 129098	  1f84a	string.o

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-07 03:18:58 +00:00
ko1
05b9b42918 * encoding.c (rb_enc_check_str): add for performance.
This function only accept T_STRING (and T_REGEXP).

  This patch improves performance of a tiny_segmenter benchmark
  (num=2) 2.54sec -> 2.42sec on my machine.
  https://github.com/chezou/TinySegmenter.jl/blob/master/benchmark/benchmark.rb

* encoding.c: add ENC_DEBUG and ENC_ASSERT() macros.

* internal.h: add a decl. of rb_enc_check_str().

* string.c (rb_str_plus): use rb_enc_check_str().

* string.c (rb_str_subpat_set): ditto.




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-29 09:10:32 +00:00
nobu
645116ff25 RUBY_DTRACE_CREATE_HOOK
* internal.h (RUBY_DTRACE_CREATE_HOOK): macro to call hook at
  object creation.

* vm.c (rb_source_location, rb_source_loc): retrieve source path
  and line number at once.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-29 05:32:57 +00:00
ko1
56eee285be revert r52336 (commit miss)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-29 05:30:50 +00:00
ko1
106f033b89 * gc.c (gc_mark_ptr): remove debug code for #11244.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-29 05:10:06 +00:00
hsbt
26cd2da784 * string.c: Added method signature to include hash. It's inconsistency
with `gsub` method signature.
  [ci skip][fix GH-1023] Patch by @danielevans

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-23 06:46:15 +00:00
nobu
bcc07ef4d1 fix backslash [ci skip]
* string.c (rb_str_tr): [DOC] Escape backslash in String#tr
  documentation.  [Fix GH-1063]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-22 15:22:22 +00:00
nobu
78baa98e69 string.c: rb_str_cat_conv_enc_opts
* file.c (rb_file_expand_path_internal): concatenate converted
  string to the result instead of making converted string and
  append it.
* string.c (rb_str_cat_conv_enc_opts): from rb_str_conv_enc_opts,
  separate function to concatenate with transcoding.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-17 04:55:47 +00:00
nobu
c2e8fb0f34 proc.c: proc without env
* proc.c (rb_sym_to_proc): move from string.c and create a Proc
  with no environments.  [ruby-core:71088] [Bug #11594]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-15 04:37:26 +00:00
ko1
e8ba0b7b04 * import a github pull request
https://github.com/ruby/ruby/pull/1050
  by Kazuho Oku <kazuho@natadeco.co>.
  This pull request has the following commits.
* gc.c: reduce # of args to 6 (max. of register args on x86-64) so
  that the `newobj_of_slowpass` can be called via TCO.
* gc.c (newobj_of), string.c (str_duplicate): for performance,
  the hot functions must be inlined.
* gc.c: for performance, preceding arguments of `.*newobj_of.*`
  must be same, so that the arg registers can be reused in case of
  TCO.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-10 06:34:24 +00:00
nobu
89dde224d4 string.c: str_duplicate
* string.c (str_duplicate): move from rb_str_resurrect to short
  circuit initialization.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-07 12:32:54 +00:00
nobu
2c31c3b45e string.c: fix non-embedded string
* string.c (rb_str_resurrect): fix resurrection of short enough to
  be embedded but not embedded string.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-07 11:43:17 +00:00
nobu
9fe491e788 string.c: optimize String#times
* string.c (rb_str_times): optimize for the argument 0 and 1.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-07 08:31:22 +00:00
nobu
8f4e6f14d8 string.c: use raw macro
* string.c (str_new_frozen): use raw macro for RString object.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-07 08:30:20 +00:00
nobu
aa4de7328d * string.c (rb_sym_to_proc): rename
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-06 07:35:52 +00:00
nobu
ceddb49868 vm_args.c: wrap symbol ifunc
* vm_args.c (args_setup_block_parameter): wrap a symbol in ifunc
  by a proc as a block parameter.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-06 06:38:08 +00:00
nobu
237332fcea string.c: optimize rb_str_resurrect
* string.c (rb_str_resurrect): optimize by short circuit to copy
  hidden string without checking length, encoding and so on.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-05 17:29:40 +00:00
nobu
de2c8c9dbc * string.c (rb_sym_proc_call): constify
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-01 10:51:09 +00:00
nobu
66296d3774 proc.c: include symbol name
* proc.c (proc_to_s): include the original symbol name in string
  form.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-30 06:36:11 +00:00
nobu
ed8b452e37 compile.c: fix performance of strconcat
* compile.c (compile_dstr_fragments): fix performance by omitting
  the first empty string only for keeping literal encoding if
  other literals are too.  [ruby-core:70930] [Bug #11556]
* string.c (rb_str_append_literal): append but keep encoding non
  US-ASCII.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-29 07:37:40 +00:00