summaryrefslogtreecommitdiff
path: root/hash.c
AgeCommit message (Collapse)Author
2012-05-23use RB_TYPE_P() instead of comparison of TYPE()nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-24* hash.c, object.c, struct.c, lib/ostruct.rb: add to_h methods.nobu
[Feature #6276] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-18Revert r35339-35343 because of no tests.naruse
* hash.c: Alias ENV.to_h to ENV.to_hash [ref #6276] * lib/ostruct.rb: Add OpenStruct#to_h [Feature #6276] * struct.c: Add Struct#to_h [Feature #6276] * object.c: Add NilClass#to_h [Feature #6276] * hash.c: Add Hash#to_h [Feature #6276] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-16* hash.c: Alias ENV.to_h to ENV.to_hash [ref #6276]marcandre
[rubyspec:6587eead7cd1] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-16* hash.c: Add Hash#to_h [Feature #6276]marcandre
[rubyspec:84b7fe3f24d2] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-13* hash.c (no_new_key): moved test to raise outside.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-13* hash.c (inspect_i): keep string's coderange.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-13* hash.c (rb_hash_aset, rb_hash_update, rb_hash_update_by): usenobu
st_update() to reduce evaluation of hash values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-12* hash.c: use RHASH_ITER_LEV(), not iter_leve directly.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-09* hash.c (rb_hash_set_default_proc): Accept nil, patch by Run Paintmarcandre
[Feature #4234] * test/ruby/test_hash.rb: test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-31* hash.c (hash_default_value): extract from rb_hash_aref(), to benobu
shared with rb_hash_shift(), so that overriding Hash#default will be respected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-31* hash.c: do not allocate st_table when it is not necessary.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-31* hash.c: remove unnecessary checks for Qundef in hash iterations.nobu
since hash use st_foreach_check for iterations, such checks are needless. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-30* st.c (st_foreach_check): remove the entry by replacing with nevernobu
when ST_DELETE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-30* hash.c (st_foreach_safe): since table is not for VALUE, Qundef isnobu
not special value, so use 0 instead. therefore this function can be applied to only st_table which 0 is invalid as keys, e.g., IDs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-30* hash.c: Qundef cannot be passed from st_foreach_check().nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-30* hash.c, marshal.c, object.c, variable.c: fix callback argument typesnobu
of iterators. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15* hash.c (env_str_new, rb_f_getenv, env_fetch): use rb_str_conv_enc()usa
instead of rb_str_encode() to simplify the code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15* win32/win32.c, include/ruby/win32.h (rb_w32_ugetenv): new API tousa
accept and to return UTF-8 strings. * win32/win32.c (rb_w32_getenv): follow above change. * win32/win32.c (rb_w32_get_environ): returns UTF-8 environment area. * hash.c (env_str_new, rb_f_getenv, env_fetch): follow above changes. [Bug #5570] [ruby-core:40737] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14* include/ruby/intern.h: Add rb_check_arity, rb_error_arity [#6085]marcandre
* array.c: Use rb_check_arity / rb_error_arity * class.c: ditto * enumerator.c: ditto * eval.c: ditto * file.c: ditto * hash.c: ditto * numeric.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * re.c: ditto * signal.c: ditto * string.c: ditto * struct.c: ditto * transcode.c: ditto * vm_eval.c: ditto * vm_insnhelper.c: ditto & implementation of rb_error_arity * test/ruby/test_arity.rb: tests for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-10* st.c: add st_foreach_check for fixing iteration over packed tablenobu
and st_delete_safe. patched by Sokolov Yura at https://github.com/ruby/ruby/pull/84 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-04* hash.c: remove trailing spaces.ktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-23* hash.c (Init_Hash): Add section on how objects are used as Hash keysdrbrain
and how to use custom classes as Hash keys. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-21* hash.c (rb_any_hash): treat Qundef like as other special constants.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-21* hash.c (hash_foreach_iter): fix signature.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-04* whitespace cleanup.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-24* complex.c: use "__sun" instead of "__sun__" to detect SunOS.akr
* math.c: ditto. * hash.c: ditto. * atomic.h: ditto. * ext/io/wait/wait.c: ditto. [ruby-dev:44693] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-18* hash.c (identhash): share with type_numhash.nobu
* st.c (st_hashtype_num): rename from type_numhash. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-04* hash.c (Init_Hash): Improve Hash documentation. Patch by Alvarodrbrain
Pereyra Rabanal. [Ruby 1.9 - Bug #5405] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-29* use RB_TYPE_P which is optimized for constant types, instead ofnobu
comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-02* hash.c (recursive_hash): hash value of emptied hash should benobu
equal to an empty hash. [ruby-core:38650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-30 * hash.c: Document ENVdrbrain
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-29 * math.c: Attach documentation for Math.drbrain
* object.c: Document NIL, TRUE, FALSE. * io.c: Improve grammar in ARGF comment. Document STDIN/OUT/ERR. Document ARGF global constant. * lib/rake: Hide deprecated toplevel constants from RDoc (import from rake trunk). * lib/thwait.rb: Document ThWait. * lib/mathn.rb: Hide Math redefinition from RDoc * lib/sync.rb: Add a basic comment for Sync_m, Synchronizer_m, Sync, Synchronizer. * parse.y: Document SCRIPT_LINES__. * hash.c: Document ENV class and global constant. * vm.c: Document TOPLEVEL_BINDING. * version.c: Document RUBY_* constants. * ruby.c: Document DATA and ARGV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-26* hash.c (rb_hash_reject): add documentation that Hash#rejectnaruse
without block returns enumerator. patched by Michael Edgar [Bug #4847] [ruby-core:36800] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18* eval.c, hash.c, load.c, proc.c, range.c, thread.c, time.c: don'takr
declare internal functions. * internal.h, vm_core.h: declare internal functions. * array.c: include internal.h. * common.mk: update dependency for array.o. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17* internal.h: declare internal functions here.akr
* node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-31 * hash.c (key_i): Change rdoc from "the first occurence" to "andrbrain
occurrence" since first occurrence is not a specification of Hash#key. [Ruby 1.9 - Bug #4760] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22 * hash.c: Improve documentation of Hash#key. Patch by Utkarshdrbrain
Kukreti. [Ruby 1.9 - Bug #4760] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-19* hash.c (ruby_setenv): check env process block size with OS ver.arton
* win32/win32.c: export rb_w32_osver for above patch. * include/ruby/win32.h: declare rb_w32_osver for Win32 Libs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-19* hash.c: refactoring prior patch (getenvsize win32 specfic function).arton
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-19* hash.c (ruby_setenv): calculate total env block size for win32.arton
* test/ruby/test_env.rb: add test for above patch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-19* hash.c (ruby_setenv): checking with max process environment block size fow ↵arton
Win32. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-08* hash.c (ruby_setenv): MSDN says that Windows XP or earlier limitsusa
the total size of environment block to 5,120 chars. and on such OS, putenv() causes SEGV. So, ruby should limit the size of an environment variable to 5,120 bytes for workaround. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-15* hash.c (inspect_i): copy the encoding of the first key asnaruse
an initial encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-30* hash.c (rb_hash_fetch_m): use useful message for longer key, not anobu
nonsense id value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-27 * hash.c (rb_hash_fetch_m): add GC guard to prevent intermediatekosaki
variable from GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-11* hash.c (hash_i): return different values for inverse hash.nobu
[ruby-core:34334] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-14* hash.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-04* hash.c (rb_hash_update_by): new API for Hash#update.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-24* array.c, gc.c, hash.c, object.c, string.c, struct.c,nobu
transcode.c, variable.c, vm.c, vm_insnhelper.c, vm_method.c: replace calls to rb_error_frozen() with rb_check_frozen(). a patch from Run Paint Run Run at [ruby-core:32014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e