summaryrefslogtreecommitdiff
path: root/string.c
AgeCommit message (Collapse)Author
2009-09-18* string.c: added rdocs for symbol.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-18* string.c: fixed types.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-15Use rb_isspace for ASCII-incompatible strings.naruse
* string.c (rb_str_split_m): use rb_isspace when the string may be ASCII-incompatible. (rb_str_lstrip_bang): ditto. (rb_str_rstrip_bang): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-14* string.c (rb_str_lstrip_bang): use ascii_isspace(). [ruby-dev:39322]matz
* string.c (rb_str_rstrip_bang): ditto. * string.c (rb_str_split_m): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-14* string.c (rb_str_inspect): use rb_enc_mbc_to_codepointnaruse
because we already knew char is found and got length. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-08* include/ruby/st.h (st_hash_func): use st_index_t.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-16* string.c (rb_str_upto): generate numerical sequence whenmatz
characters in both edges are all digits. [ruby-talk:343186] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-12* insns.def, vm.c, vm_insnhelper.c, vm_insnhelper.h: checkko1
definition of (classes)#=== for case/when optimization. Fix Bug #1376 [ruby-core:23190]. * string.c (Init_String), bignum.c (Init_Bignum), numeric.c (Init_Numeric): define String#===, Symbol#===, Bignum#===, Fixnum#===, Float#=== as same as (classes)#==. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-12* string.c (rb_str_new_frozen): must not change encoding of frozennobu
shared string. [ruby-dev:39068] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-01* string.c (tr_trans): change condition of singlebyte optimization.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-31 Can't use singlebyte optimization when the replacement is multibyte. ↵naruse
[ruby-core:24612] * string.c (tr_trans): can't use singlebyte optimization when the replacement is multibyte. [ruby-core:24612] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-18* string.c (rb_str_hash_cmp): got rid of overflow.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-14Check pos and strlen on Regexp#index(str, pos) [ruby-core:23660]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-01* hash.c (rb_hash_hash): documentation fix. a patch frommatz
Marc-Andre Lafortune. [ruby-core:23943] * object.c (rb_mod_cmp): ditto. * range.c (range_eq): ditto. * string.c (rb_str_partition, rb_str_rpartition): ditto. * struct.c (rb_struct_s_def): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-30* re.c (reg_match_pos): adjust offset based on characters, notmatz
bytes. [ruby-dev:38722] * string.c (rb_str_offset): new function. * string.c (rb_str_index_m): no call to rb_reg_adjust_startpos(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-16* array.c (rb_ary_memsize): added.ko1
* io.c (rb_io_memsize): added. * regcomp.c (onig_memsize): added. * string.c (rb_str_memsize): added. * transcode.c (rb_transcoding_memsize, rb_econv_memsize): added. * variable.c (rb_geneic_ivar_memsize): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-11* string.c (str_replace_shared): shared target must be frozen.nobu
[ruby-core:23727] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-02* string.c (rb_str_gsub_bang): modify check at the beginning.matz
[ruby-core:23662] ref [ruby-core:23657] * string.c (rb_str_rstrip_bang): ditto. [ruby-core:23657] * string.c (rb_str_chop_bang): ditto. * string.c (rb_str_chomp_bang): ditto. * string.c (rb_str_reverse_bang): modify check added. [ruby-core:23671] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-25* string.c (rb_str_each_char, rb_str_each_codepoint): stringnobu
length must be long. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-25* string.c (rb_str_hash): avoid calling rb_enc_str_asciionly_p().matz
* string.c (rb_str_replace): avoid redundant calling rb_str_new4(). * string.c (str_replace): factor out replacement from rb_str_replace() without type check nor discarding the destination contents. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-24* string.c (rb_str_rpartition): ditto.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-24* string.c (rb_str_partition): should use the converted result. anobu
patch from Marc-Andre Lafortune at [ruby-core:23540]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-23* string.c (rb_str_each_char): return original string.matz
[ruby-core:23499] * string.c (rb_str_each_codepoint): protect string from modification. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-21* string.c (rb_str_count): optimized for 1byte string count bymatz
avoiding tr_setup_table(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-20* encoding.c (rb_enc_fast_mbclen): faster mbclen for strings knownmatz
to be valid. * string.c (enc_strlen): coderange specified version of rb_enc_strlen(). use rb_enc_fast_mbclen() if coderange is 7bit or valid. * string.c (str_gsub): use rb_enc_fast_mbclen(). * string.c (rb_str_reverse, rb_str_split_m, rb_str_each_char, scan_once): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-19* encoding.c (rb_enc_codepoint_len): combine rb_enc_codepoint()matz
and rb_enc_codelen() in one function to reduce calls. * encoding.c (rb_enc_codepoint): compatibility function. * sprintf.c (rb_str_format): use rb_enc_codepoint_len(). * string.c (rb_str_inspect, rb_str_upcase_bang, rb_str_downcase_bang, rb_str_capitalize_bang, rb_str_swapcase_bang, trnext, tr_trans, rb_str_delete_bang, rb_str_squeeze_bang, rb_str_count, rb_str_split_m, rb_str_each_line, rb_str_each_codepoint, rb_str_lstrip_bang, sym_printable): ditto. * transcode.c (make_econv_exception): use rb_enc_mbc_to_codepoint() git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-09rdoc update.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-07* string.c, include/ruby/encoding.h: fixed types.nobu
* include/ruby/encoding.h (rb_enc_nth): long is used for index. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-20* string.c (rb_str_split_m): faster processing on 7bit strings.matz
* string.c (ascii_isspace): faster isspace() for 7bit strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-08* string.c (rb_str_dump): buffer length plus one byte for nullmame
terminator. [ruby-dev:38294] * test/ruby/test_m17n.rb (test_str_dump): add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-08* string.c (rb_str_rstrip_bang): should not sign-expand non-ascii.nobu
[ruby-core:23158] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-08* string.c (rb_str_chop_bang): reset coderange. [ruby-core:23155]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-17* dir.c, dln.c, parse.y, re.c, ruby.c, sprintf.c, strftime.c,nobu
string.c, util.c, variable.c: use strlcpy, memcpy and snprintf instead of strcpy, strncpy and sprintf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-15* string.c (rb_hash_uint, rb_hash_start, rb_hash_end): use VALUEnobu
rather than unsigned int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-14* string.c (rb_str_subpat): accept capture name.akr
(rb_str_aref): follow above change. (rb_str_aref_m): pass the 2nd argument to rb_str_subpat. (rb_str_subpat_set): accept capture name. (rb_str_aset): follow above change. (rb_str_partition): ditto. (rb_str_aset_m): pass the 2nd argument to rb_str_subpat_set. * include/ruby/intern.h (rb_reg_backref_number): declared. * re.c (rb_reg_backref_number): defined. [ruby-core:21057] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-12* array.c, bignum.c, dln.c, error.c, gc.c, io.c, marshal.c,nobu
numeric.c, pack.c, strftime.c, string.c, thread.c, transcode.c, transcode_data.h, util.c, variable.c, vm_dump.c, include/ruby/encoding.h, missing/crypt.c, missing/vsnprintf.c: suppress VC type warnings. [ruby-core:22726] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-10* array.c, bignum.c, gc.c, numeric.c, string.c, util.c, insns.def,nobu
missing/crypt.c, missing/vsnprintf.c, : suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-05* string.c (str_eql): extracted from rb_str_equal and rb_str_eql.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-05* string.c (rb_str_chomp_bang): keeps 7bit coderange.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-25* string.c (rb_str_each_line): constified.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-25* string.c (rb_str_force_encoding): should clear coderange at changingnobu
encoding. [ruby-core:22437] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-24* string.c (rb_str_chomp_bang): coderange may change.nobu
[ruby-core:22414] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-24* string.c (rb_str_delete_bang): should recalculate coderange.nobu
[ruby-talk:329267] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22stripped trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22* string.c (tr_trans): should recalculate coderange.nobu
[ruby-core:22326] (reopened at [ruby-core:22328]) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22* string.c (tr_trans): should not be affected by the encoding ofnobu
replacement unless actually modified. [ruby-talk:328967] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-18* array.c (rb_ary_resurrect), string.c (rb_str_resurrect): newnobu
functions based on [ruby-dev:37983] * insns.def (putstring, duparray): use rb_{ary,str}_resurrect(). * iseq.c (iseq_data_to_ary): needs to result TS_VALUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-17* string.c (rb_str_shared_replace): no need fornobu
str_make_independent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-14* string.c (rb_hash_uint32, rb_hash_uint, rb_hash_start, rb_hash_end),mame
include/ruby/intern.h: add Murmurhash API. [ruby-dev:37784] * complex.c (nucomp_hash), array.c (rb_ary_hash), time.c (time_hash), string.c (rb_str_hsah), object.c (rb_obj_hash), range.c (range_hash), struct.c (rb_struct_hash), hash.c (rb_any_hash), rational.c (nurat_hash): use Murmurhash. [ruby-dev:37784] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-13* string.c (rb_external_str_new_with_enc): change evaluatioin ordernaruse
for speed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e