Commit Graph

111 Commits

Author SHA1 Message Date
yui-knk 45305686fe Add a space aftre bracket. 2014-05-18 19:40:17 +09:00
Yukihiro "Matz" Matsumoto 91cc8949e8 use mrb_field_write_barrier_value() in hash.c 2014-05-08 11:09:08 +09:00
Yukihiro "Matz" Matsumoto 5138f62d6b resolve conflict 2014-04-15 10:55:46 +09:00
Yukihiro "Matz" Matsumoto 8d95e5a0de use kh_put2 in mrb_hash_set for performance improvement 2014-04-13 18:26:13 +09:00
Yukihiro "Matz" Matsumoto 63cf7073de improve hash function based on #2027; close #2027 2014-04-09 11:49:26 +09:00
Yukihiro "Matz" Matsumoto 59cd24d41f Hash#replace should copy default as well; close #2004 2014-04-04 12:14:23 +09:00
Yukihiro "Matz" Matsumoto b9a4d64064 implement Hash#initialize in C 2014-04-04 11:03:26 +09:00
Yukihiro "Matz" Matsumoto 28ab106292 Hash#replace to preserve order; close #2001 2014-04-04 10:50:42 +09:00
ksss 8d15ef2e89 Use bool macro KHASH_DEFINE and KHASH_DECLARE 2014-04-02 13:38:43 +00:00
Yukihiro "Matz" Matsumoto 164dcd8b33 Hash#keys to update memory region directly 2014-04-01 15:19:53 +09:00
Yukihiro "Matz" Matsumoto 312e11da39 should adjust hash value order at deletion 2014-04-01 15:19:11 +09:00
Yukihiro "Matz" Matsumoto 1690fc4c99 implement Hash#== and eql? in Ruby 2014-04-01 14:56:23 +09:00
Yukihiro "Matz" Matsumoto 8b141b07b6 function expansion in hash.c 2014-04-01 14:37:10 +09:00
Yukihiro "Matz" Matsumoto cf58d0d3e9 move Hash#inspect implementation to mrblib/hash.rb 2014-04-01 14:21:40 +09:00
Yukihiro "Matz" Matsumoto f05069fd1a Hash to preserve order as Ruby1.9 does 2014-04-01 14:18:21 +09:00
Yukihiro "Matz" Matsumoto 4c2969910f Hash function to avoid funcalls if possible 2014-03-31 13:44:35 +09:00
Yukihiro "Matz" Matsumoto 62505d51cc calc hash value directly for strings, symbols and numbers 2014-03-15 15:53:12 +09:00
take_cheeze 7c4961234d fix mrb_funcall calling 2014-03-12 10:18:38 +09:00
cremno bfc522bcd5 use mrb_str_cat_lit for literals 2014-03-08 18:38:31 +01:00
ksss d7b179475b fix #1823 2014-03-08 17:51:21 +09:00
Yukihiro "Matz" Matsumoto fe1b4cea41 Hash#== and eql? should not return fixnum; ref #1823 2014-03-07 18:40:10 +09:00
ksss cab1f734ef Fix behavior Hash#eql? 2014-03-07 11:08:24 +09:00
cubicdaiya bd0244d067 use mrb_str_cat_lit() intead of mrb_str_cat 2014-02-27 22:42:25 +09:00
Li Yazhou adbf1eba99 clearn up warning in hash.c
/home/fleuria/code/mruby/src/hash.c:159:1: warning: ‘mrb_hash_dp`defined but not used [-Wunused-function]
 mrb_hash_dup(mrb_state *mrb, mrb_value hash)
     ^

this commit defines Hash#dup to take advantage of mrb_hash_dup, however
it seems that Hash#dup is not in ISO standard.
2014-02-14 13:22:30 +08:00
cremno 4ffea85b62 hash / hash-ext: various small changes
src/hash.c:
 - mrb_hash_(aget|aset|dup|delete): internal linkage
 - remove documentation of methods which are not implemented (in here)
 - remove #assoc; unused, not in ISO spec
 - remove #rassoc: same, implementation is also wrong

hash-ext mrbgem:
 - remove header "mruby/khash.h"
 - remove mrb_hash_values_at (move code into hash_values_at, i: long -> int)
 - less whitespace in gem_init function
2014-02-13 13:39:09 +01:00
Yukihiro "Matz" Matsumoto 19a08b8455 Merge pull request #1674 from cremno/mrb_bool-FALSE-TRUE
use mrb_bool, FALSE and TRUE more
2014-02-09 18:35:20 +09:00
Yukihiro "Matz" Matsumoto 4a2c37df93 made mrb_define_class to return existing class, with heavy refactoring 2014-02-08 13:44:31 +09:00
Yukihiro "Matz" Matsumoto 7ba4612956 use mrb_str_new_lit() more widely 2014-02-06 08:54:47 +09:00
cremno 4507985c3e use mrb_bool, FALSE and TRUE more
It doesn't matter to me if one is using FALSE/TRUE instead of 1/0
but I prefer a type (alias) which emphasizes boolean vars to int.
I changed 1/0 to FALSE/TRUE anyway.
2014-01-31 18:00:36 +01:00
crimsonwoods 370ad6fade Remove 'mrb_state' field from 'kh_xxx_t' structure.
'kh_xxx_t' requires 'mrb_state' to allocate, free, and compute hash value.
But 'mrb_state' should not be held by 'kh_xxx_t' and 'mrb_state' should be
supplied from outside.
2013-12-23 00:33:07 -08:00
take_cheeze df780ae5e9 add mrb_intern_lit for creating symbol from string literal 2013-12-01 10:38:59 +09:00
Yukihiro "Matz" Matsumoto 9c6398a444 rename mrb_intern2() to mrb_intern(); huge API incompatibility; close #1513 2013-11-29 08:47:28 +09:00
Jun Hiroe 0e5ecae325 Refactor mrb_hash_empty_p() func in hash.c 2013-06-27 21:23:12 +09:00
Yukihiro "Matz" Matsumoto b44309b4b2 Merge pull request #1308 from suzukaze/refactor-hash-c
Refactor mrb_hash_has_keyWithKey() func in hash.c
2013-06-26 16:00:29 -07:00
Jun Hiroe 4dfa2033b6 Refactor mrb_hash_has_keyWithKey() func in hash.c 2013-06-26 23:00:42 +09:00
Carson McDonald 1d4b26ecfc Add arena save/restore around use of hash KEY. 2013-06-26 08:37:28 -04:00
Daniel Bovensiepen 373122a299 Merge upstream 2013-06-15 03:53:50 +08:00
Daniel Bovensiepen 029ed96510 Add ISO Number to Hash 2013-06-17 04:49:56 +08:00
Ryan Scott 0d4227ac04 Implemented ObjectSpace.count_objects to count the number of allocated objects for each type 2013-05-12 18:42:21 +10:00
Masaki Muranaka c9edc5b02e Remove mrb_hash_lookup() as no one uses it. Use mrb_hash_get instead. 2013-05-08 13:33:23 +09:00
Masaki Muranaka 82c891acee Move comments from hash.c to hash.rb. 2013-05-08 13:22:35 +09:00
Masaki Muranaka a46eacb213 Move Hash#values_at to mruby-hash-ext gem. 2013-05-08 13:22:35 +09:00
Yukihiro "Matz" Matsumoto 443b2c2a2b rename hash related gc functions 2013-04-29 07:48:33 +09:00
Yukihiro "Matz" Matsumoto 30d580ecbc rename every ARGS_XXX to MRB_ARGS_XXX; ref #1206 2013-04-25 09:47:36 +09:00
Masaki Muranaka 2b5b161f8b Sort include files. Some redundant includes are removed. 2013-03-29 10:22:31 +09:00
Masaki Muranaka 92821cf2ef Use mrb_str_cat() instead of mrb_str_cat2() as possible. 2013-03-23 15:55:55 +09:00
Yukihiro "Matz" Matsumoto acab35a2a5 Merge pull request #1039 from crimsonwoods/fix_the_type_of_opcode
Fix the type of value that is returned by bit shift expression.
2013-03-22 19:11:51 -07:00
Masaki Muranaka f8fa56d8c3 Use mrb_intern2() instead of mrb_intern(). This is for avoiding overhead by strlen(). 2013-03-22 14:22:45 +09:00
crimsonwoods c1f6a27660 fix the type of value that is returned by bit-shift expression. 2013-03-21 22:57:14 +09:00
Yukihiro Matz Matsumoto d0d920e909 rename mrb_true_or_false_value() to mrb_bool_value() 2013-03-19 12:03:54 +09:00