summaryrefslogtreecommitdiffstats
path: root/string.c
Commit message (Collapse)AuthorAgeFilesLines
* * string.c (str_utf8_nth): no count_utf8_lead_bytes_with_wordnobu2009-11-181-3/+1
| | | | | | | | | | optimization for short string. [ruby-core:26787] * string.c (str_utf8_offset): str_utf8_nth never return NULL. ?\012 git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_utf8_nth): fixed overrun. [ruby-core:26787]nobu2009-11-171-0/+1
| | | | | | | ?\012 git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_each_line): rdoc fixmarcandre2009-11-091-3/+3
| | | | | | * ext/bigdecimal/bigdecimal.c (#infinite?, #nonzero?): rdoc fix git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * random.c (rb_hash_start): moved from string.c.nobu2009-11-031-26/+0
| | | | | | | | | * random.c (Init_RandomSeed2): register global address before set. * random.c (Init_RandomSeed): initialize hashseed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_upto): make next object before yield its block.naruse2009-11-031-3/+6
| | | | | | | fix: can modify original begin string of String#upto. [ruby-dev:26384] [ruby-dev:39626] #2327 git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (trnext): detect empty range and raise exception.matz2009-10-301-1/+11
| | | | | | [ruby-dev:39108] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_sub_bang): trivial optimization.nobu2009-10-291-14/+17
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c: rdoc for <=>, casecmpmarcandre2009-10-281-4/+4
| | | | | | | | | | | | * bignum.c: rdoc for <=> * file.c: ditto * time.c: ditto * compar.c: rdoc git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (chopped_length): get rid of unexpected exception.nobu2009-10-271-2/+2
| | | | | | | see [ruby-core:26336]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix a typo.akr2009-10-171-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (rb_intern3): check symbol table overflow.nobu2009-10-151-17/+2
| | | | | | | [ruby-core:26092] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_check_string_type): rdoc fix [ruby-core:26084]marcandre2009-10-141-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): copy by chunks.nobu2009-10-071-29/+32
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): don't assign -1 to unsigned int.naruse2009-10-071-19/+12
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_upto): RDoc updated. a patch from Nobuhiromatz2009-10-061-0/+8
| | | | | | IMAI <nov at yo.rim.or.jp> in [ruby-dev:39440]. [ruby-dev:39439] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_{times, shuffle_bang, sample}): reducing macromatz2009-10-051-11/+16
| | | | | | | | | | | | | calls inside of the loop by keeping pointers in local variables. a patch from Masahiro Kanai (CanI) in [ruby-dev:39406]. It was found and fixed at Security and Programming camp 2009. * string.c (rb_str_{times, split_m}): ditto. * struct.c (rb_struct_{getmember, set, aref_id, aset_id}, {make, inspect}_struct, recursive_{equal, hash, eql}): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Escape as \x{XXXX} other than Unicode chars.naruse2009-09-291-8/+17
| | | | | | | * string.c (rb_str_inspect): escape as \x{XXXX} when the encoding is other than Unicode. [ruby-dev:39388] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): dump as \uXXXX when thenaruse2009-09-291-9/+21
| | | | | | string is in Unicode. [ruby-dev:39388] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_f_getenv): use rb_filesystem_str_new_cstrnaruse2009-09-281-0/+12
| | | | | | | | | | | | | | | | | | | instead of rb_str_new2. ENV['PATH'].encoding should be Filesystem Encoding because its content is related to filesystem. see [ruby-dev:39393] * hash.c (env_fetch): ditto. * string.c (rb_filesystem_str_new): defined. * string.c (rb_filesystem_str_new_cstr): ditto. * include/ruby/intern.h (rb_filesystem_str_new): added. * include/ruby/intern.h (rb_filesystem_str_new_cstr): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_buf_cat2): optimize since all second arguments arenobu2009-09-271-5/+3
| | | | | | | | | constant literals. * string.c (str_cat_char): unused now. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_hash_{uint{32,},end}): removed.nobu2009-09-271-8/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* String#inspect's encoding should be fixed.naruse2009-09-261-31/+31
| | | | | | | | | | | | | | | | * string.c (rb_str_inspect): result's encoding should be fixed. If default_internal is not nil, the encoding is default_internal. Else if default_external is not nil, the encoding is default_external. But the encoding is not ASCII-compatible, the encoding is replaced by US-ASCII. Characters in ASCII-incompatible encoding or non ASCII characters in other than the encoding will be \xXX escaped. * string.c (str_buf_cat2): defined. * string.c (prefix_escape): removed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c: use rename-macro instead of RUBY_ALIAS_FUNCTION_TYPE.ko12009-09-261-9/+4
| | | | | | | | Because build causes failure. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * st.c: moved murmur hash from string.c. [ruby-dev:39376]nobu2009-09-261-241/+14
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (hash): updated to MurmurHash 2.0 2009-09-19.nobu2009-09-261-69/+88
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_hash_start): fixed shift width on 128bit platform.nobu2009-09-261-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_upto): keep first width. [ruby-dev:39361]nobu2009-09-231-4/+10
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c: added rdocs for symbol.nobu2009-09-181-0/+88
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c: fixed types.nobu2009-09-181-40/+45
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use rb_isspace for ASCII-incompatible strings.naruse2009-09-151-4/+4
| | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@24934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_lstrip_bang): use ascii_isspace(). [ruby-dev:39322]matz2009-09-141-5/+5
| | | | | | | | * string.c (rb_str_rstrip_bang): ditto. * string.c (rb_str_split_m): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_inspect): use rb_enc_mbc_to_codepointnaruse2009-09-141-2/+1
| | | | | | because we already knew char is found and got length. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/st.h (st_hash_func): use st_index_t.nobu2009-09-081-15/+15
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_upto): generate numerical sequence whenmatz2009-08-161-3/+45
| | | | | | characters in both edges are all digits. [ruby-talk:343186] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def, vm.c, vm_insnhelper.c, vm_insnhelper.h: checkko12009-08-121-0/+2
| | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@24511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_new_frozen): must not change encoding of frozennobu2009-08-121-3/+4
| | | | | | | shared string. [ruby-dev:39068] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (tr_trans): change condition of singlebyte optimization.naruse2009-08-011-2/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Can't use singlebyte optimization when the replacement is multibyte. ↵naruse2009-07-311-1/+2
| | | | | | | | | [ruby-core:24612] * string.c (tr_trans): can't use singlebyte optimization when the replacement is multibyte. [ruby-core:24612] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_hash_cmp): got rid of overflow.nobu2009-07-181-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Check pos and strlen on Regexp#index(str, pos) [ruby-core:23660]naruse2009-07-141-0/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * hash.c (rb_hash_hash): documentation fix. a patch frommatz2009-07-011-8/+13
| | | | | | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@23930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (reg_match_pos): adjust offset based on characters, notmatz2009-06-301-3/+8
| | | | | | | | | | 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: http://svn.ruby-lang.org/repos/ruby/trunk@23916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_memsize): added.ko12009-06-161-0/+11
| | | | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@23714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_replace_shared): shared target must be frozen.nobu2009-06-111-2/+9
| | | | | | | [ruby-core:23727] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_gsub_bang): modify check at the beginning.matz2009-06-021-6/+10
| | | | | | | | | | | | | | [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: http://svn.ruby-lang.org/repos/ruby/trunk@23620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_each_char, rb_str_each_codepoint): stringnobu2009-05-251-2/+3
| | | | | | | length must be long. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_hash): avoid calling rb_enc_str_asciionly_p().matz2009-05-251-24/+31
| | | | | | | | | | * 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: http://svn.ruby-lang.org/repos/ruby/trunk@23565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_rpartition): ditto.nobu2009-05-241-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_partition): should use the converted result. anobu2009-05-241-0/+1
| | | | | | | patch from Marc-Andre Lafortune at [ruby-core:23540]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_each_char): return original string.matz2009-05-231-2/+5
| | | | | | | | | [ruby-core:23499] * string.c (rb_str_each_codepoint): protect string from modification. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e