summaryrefslogtreecommitdiff
path: root/hash.c
AgeCommit message (Collapse)Author
2010-03-06* hash.c (Hash#merge doc): Added explanation for form with block.marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-14* hash.c (ruby_setenv): get rid of crash in Solaris 8 and 10.nobu
[ruby-core:26668] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-05Merged r22308. [ruby-dev:39637]naruse
* hash.c (rb_hash): always return a fixnum value because a return value of rb_hash may be used as a hash value itself and bignums have no unique VALUE. * test/ruby/test_hash.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-24* hash.c (doc): doc fix, patch by Run Paint Run Run [ruby-core:23644]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-24* hash.c (rehash doc): doc fix [ruby-core:23628]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-20* array.c (Array#try_convert): New method backported from 1.9.knu
* hash.c (Hash#try_convert): New method backported from 1.9. * io.c (IO#try_convert): New method backported from 1.9. * re.c (Regexp#try_convert): New method backported from 1.9. * string.c (String#try_convert): New method backported from 1.9. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-11* hash.c (rb_hash_s_create): set nil as the value if assoc lengthnobu
is not enough. [ruby-core:21249] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@21423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-16* array.c (rb_ary_nitems, rb_ary_choice): Add a deprecationknu
warning. * hash.c (env_index, rb_hash_index): Simplify the deprecation warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@20783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-07* hash.c (rb_hash_key, env_key): Hash#index is renamed toknu
Hash#key, and ENV.index to ENV.key. [ruby-dev:37028] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@20130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* hash.c (ENVMATCH, ENVNMATCH): reduced same code.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@19474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-13* hash.c (rb_hash_set_default_proc): Add Hash#default_proc=;knu
submitted by Giuseppe Bilotta. #420 * eval.c (rb_obj_is_proc), intern.h: Export rb_obj_is_proc(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@18580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-07* hash.c (hash_i): make Hash#hash order insensitive.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-25* hash.c (rb_hash_default): Fix rdoc.knu
(rb_hash_each, env_each_value, env_each_pair): Return an enumerator if no block is given. (rb_hash_update): Update rdoc. (envix): Conditionalize the definition itself. (rb_f_getenv, env_fetch, env_keys, env_values, env_values_at) (env_select, env_inspect, env_to_a, env_empty_p, env_has_key) (env_has_value, env_index, env_indexes, env_to_hash, env_shift) (env_update): Require secure level 4. (env_each_value, env_each_i): Delay variable initialization. (env_each_key, env_each_value, env_reject_bang) (env_clear, env_replace): Omit duplicated secure level check. (env_has_value): Do to_str conversion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-25* hash.c (env_delete_if): Return an enumerator if no block isknu
given. (env_each_key): Delay a variable initialization after RETURN_ENUMERATOR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-21* hash.c (rb_hash_delete): rdoc fix based on a patch from Gaston Ramosnobu
<ramos.gaston AT gmail.com>. [ruby-core:16825] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-21 * hash.c (recursive_hash): prototype.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-19* array.c (rb_ary_equal, rb_ary_eql, rb_ary_hash, rb_ary_cmp):knu
Make Array#eql?, #hash, #== and #<=> use rb_exec_recursive() and handle recursive data properly. * hash.c (hash_equal, rb_hash_hash): Make Hash#eql?, #hash and #== use rb_exec_recursive() and handle recursive data properly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-19* intern.h, hash.c (rb_hash_lookup): New internal function toknu
check if a key exists in a hash, ignoring #default; backported from 1.9. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-14* array.c (rb_ary_collect_bang, rb_ary_select): Return anknu
enumerator if no block is given. * dir.c (dir_each, dir_foreach): Return an enumerator if no block is given. * enum.c (enum_partition, enum_sort_by): Ditto. * gc.c (os_each_obj): Ditto. * hash.c (rb_hash_delete_if, rb_hash_reject_bang, rb_hash_select, rb_hash_each_value, rb_hash_each_key, rb_hash_each_pair, env_each_key, env_each_value, env_each, env_each_pair, env_reject_bang, env_delete_if, env_select): Ditto. * numeric.c (num_step, int_upto, int_downto, int_dotimes): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-03* hash.c (rb_any_hash): shrinks all results in Fixnum range.nobu
[ruby-core:15713] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-02* array.c (rb_ary_assoc): check and convert inner arrays (assocs)matz
using #to_ary. * hash.c (rb_hash_s_create): check and convert argument hash using #to_hash. * hash.c (rb_hash_s_create): Hash#[] now takes assocs as source of hash conversion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-21* hash.c (st_foreach_func, rb_foreach_func): typedefed.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-15* hash.c (rb_hash_delete_key): delete the entry without calling block.nobu
* hash.c (rb_hash_shift): should consider iter_lev too. * hash.c (delete_if_i): use rb_hash_delete_key() so that the block isn't called twice. [ruby-core:11556] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-29* hash.c: purged trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-22* hash.c (rb_hash_select): remove unnecessary varargs formatz
rb_hash_select. a patch from Daniel Berger <Daniel.Berger at qwest.com>. [ruby-core:11527] * hash.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-23* hash.c: added documentation for Hash about how it uses eql? andmatz
hash methods for the keys. [ruby-core:09995] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-29* hash.c (rb_hash_s_create): fixed memory leak, based on the patchnobu
by Kent Sibilev <ksruby at gmail.com>. fixed: [ruby-talk:211233] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-06* hash.c (rb_hash_default): should not call default procedure ifmatz
no key is given. [ruby-list:42541] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-01* configure.in, hash.c (ruby_setenv): use setenv(3) and unsetenv(3)ocean
where they are supported. modifing environ variable seems to segfault solaris 10. [ruby-core:7276] [ruby-dev:28270] * ruby.c (set_arg0): if use setenv(3), environ space cannot be used for altering argv[0]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-07-19* io.c (rb_io_inspect): replace sprintf() with "%s" format allmatz
over the place by snprintf() to avoid integer overflow. * sample/svr.rb: service can be stopped by ill-behaved client; use tsvr.rb instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-28* dir.c, eval.c, hash.c, process.c, ruby.c: avoid warning "unusedocean
variable" [ruby-dev:26387] (patch from Kazuhiro NISHIYAMA) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-13* hash.c (ruby_setenv): fixed SEGV. [ruby-dev:26186]ocean
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-02-28* exception error messages updated. [ruby-core:04497]matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-02-08* lib/cgi.rb (CGI::Cookie): [ruby-talk:130040]matz
* object.c: [ruby-doc:818] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-18* dir.c (dir_open_dir): new function. [ruby-dev:25242]matz
* hash.c (Init_Hash): remove custom "hash" and "eql?". * lib/set.rb (Set::eql): wrong definition. [ruby-dev:25207] * object.c (rb_obj_id_obsolete): warn always. * eval.c (rb_enable_super): ditto. * lib/set.rb (Set#==): [ruby-dev:25206] * lib/pstore.rb (PStore#transaction): Use the empty content when a file is not found. [ruby-dev:24561] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-06* process.c (proc_setgroups): [ruby-dev:25081]matz
* re.c (rb_reg_eqq): document fix. [ruby-talk:122541] * ext/socket/socket.c (sock_connect): use rb_str_new4(). [ruby-dev:25052] * io.c (io_write): remove rb_str_locktmp(). [ruby-dev:25050] * io.c (io_fwrite): takes VALUE string as an argument. [ruby-dev:25050] * ext/socket/socket.c (sock_connect): remove rb_str_locktmp(). [ruby-dev:25050] * ext/socket/socket.c (udp_connect): [ruby-dev:25045] * ext/socket/socket.c (udp_bind): ditto. * ext/socket/socket.c (udp_send): ditto. * ext/socket/socket.c (bsock_send): ditto. * ext/socket/socket.c (s_recvfrom): ditto. * hash.c (rb_hash_hash): should provide "hash" method where "eql?" is redefined. [ruby-talk:122482] * ext/socket/socket.c (bsock_setsockopt): [ruby-dev:25039] * hash.c (rb_hash_hash): should provide "hash" method where "eql?" is redefined. [ruby-talk:122482] * ext/socket/socket.c (bsock_setsockopt): [ruby-dev:25039] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-16* numeric.c (flo_divmod): protect float values from GC bymatz
assignment to local variables. [ruby-dev:24873] * string.c (str_mod_check): frozen check should be separated. [ruby-core:3742] * array.c (rb_ary_update): pedantic check to detect rb_ary_to_ary() to modify the receiver. [ruby-dev:24861] * string.c (rb_str_justify): typo fixed. [ruby-dev:24851] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-02* string.c (rb_str_sum): check was done with false pointer.matz
[ruby-dev:24383] * string.c (rb_str_sum): string may be altered. [ruby-dev:24381] * eval.c (rb_f_eval): defer pointer retrieval to prevent unsafe sourcefile string modification. [ruby-dev:24373] * io.c (io_read): block string buffer modification during rb_io_fread() by freezing it temporarily. [ruby-dev:24366] * io.c (rb_io_s_popen): mode argument may be altered. [ruby-dev:24375] * file.c (rb_file_s_basename): ext argument may be altered. [ruby-dev:24377] * enum.c (enum_sort_by): use NODE instead of 2 element arrays. [ruby-dev:24378] * string.c (rb_str_chomp_bang): StringValue() may change the receiver. [ruby-dev:24371] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-22* hash.c (rb_hash_rehash): add iteration check. [ruby-dev:24301]matz
* st.c (st_foreach): add deep check. * array.c (rb_ary_collect_bang): element size might change during comparison. [ruby-dev:24300] * array.c (rb_ary_reject_bang): ditto. [ruby-dev:24300] * array.c (rb_ary_eql): ditto. [ruby-dev:24300] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-21* array.c (rb_ary_uniq_bang): element size might change duringmatz
comparison. [ruby-dev:24298] * enum.c (enum_sort_by): do not use qsort directly. use rb_ary_sort_bang() instead. [ruby-dev:24291] * enum.c (enum_sort_by): pedantic type check added. [ruby-dev:24291] * hash.c (rb_hash_foreach_iter): check iter_lev after each iteration. [ruby-dev:24289] * array.c (rb_ary_and): element size might change during comparison. [ruby-dev:24290] * array.c (rb_ary_or): ditto. [ruby-dev:24292] * array.c (rb_ary_equal): wrong fix. [ruby-dev:24286] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-05-13* hash.c (delete_if_i): use st_delete_safe() (viaeban
rb_hash_delete()) instead of returning ST_DELETE. backport from HEAD. [ruby-dev:23487] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-05-07* eval.c (rb_eval): too many line trace call. (ruby-bugs PR#1320)matz
* numeric.c (flo_to_s): tweak output string based to preserve decimal point and to remove trailing zeros. [ruby-talk:97891] * string.c (rb_str_index_m): use unsigned comparison for T_FIXNUM search. [ruby-talk:97342] * hash.c (rb_hash_equal): returns true if two hashes have same set of key-value set. [ruby-talk:97559] * hash.c (rb_hash_eql): returns true if two hashes are equal and have same default values. * string.c (rb_str_equal): always returns true or false, never returns nil. [ruby-dev:23404] * io.c (rb_io_reopen): should use rb_io_check_io(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-05* eval.c (top_include): include in the wrapped load is done formatz
the wrapper, not for a singleton class for wrapped main. [ruby-dev:23305] * bignum.c (rb_big_eq): use temporary double variable to save the result (internal float register may be bigger than 64 bits, for example, 80 bits on x86). [ruby-dev:23311] * eval.c (block_pass): should generate unique identifier of the pushing block. [ruby-talk:96363] * ext/socket/socket.c (make_hostent): fix memory leak, based on the patch from HORIKAWA Hisashi <[email protected]>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-23RDoc comments for Fixnum, Float, and Hash. Add heuristic to RDoc to handle ↵dave
yaml/stringio git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-22* eval.c (rb_with_disable_interrupt): use ENABLE_INTS instead ofmatz
ALLOW_INTS which may switch context. [ruby-dev:22319] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-20dln.c: remove last second typo.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-12-19* misc/ruby-mode.el (ruby-calculate-indent): proper indentationmatz
inside of parentheses. [ruby-dev:22308] * hash.c (delete_if_i): do not use ST_DELETE for thread safety. [ruby-dev:21899] (not fully solved) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-28* hash.c (env_has_value, env_index): must match exactly.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-25* defines.h (ENV_IGNORECASE): should define when DOSISH withoutusa
human68k. * hash.c (env_has_value, env_index): don't ignore case of value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-15* hash.c: remove unnecessary update.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e