Commit Graph

90 Commits

Author SHA1 Message Date
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
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
Masaki Muranaka 84b279d915 Use mrb_true_or_false_value() / in hash_equal(). 2013-03-19 11:04:21 +09:00
Masaki Muranaka 615e8560b8 Use mrb_true_or_false_value() / in mrb_hash_has_keyWithKey(). 2013-03-19 11:04:21 +09:00
Masaki Muranaka 50ad607e91 Use mrb_true_or_false_value() / in mrb_hash_empty_p(). 2013-03-19 11:04:21 +09:00
Yukihiro Matz Matsumoto 243669308d obsolete mrb_object; opposite of bc870ce 2013-03-15 23:16:20 +09:00
MATSUMOTO Ryosuke 809732ab40 Adjust some indents 2013-03-02 10:26:54 -08:00
Masaki Muranaka da9b9c549a Remove unused structures. 2013-03-01 13:18:57 +09:00
brainopia db6e6dc5b8 Remove freeze leftovers 2013-02-27 09:47:05 +04:00
Masaki Muranaka d864648506 Clean code up. 2013-02-26 19:16:48 +09:00
Masaki Muranaka b833df3d37 Remove commented out code. Remove redundant function calls. 2013-02-24 00:11:48 +09:00
Masamitsu MURASE aeb8e2eaac Fix potential bug about Hash. 2013-02-03 16:52:43 +09:00
skandhas 1a528da40b add mrb_check_hash_type 2013-01-10 17:02:41 +08:00
Ryunosuke SATO ee0563823d Stop warning: extra ';' outside of a function 2012-11-30 22:43:53 +09:00
Yukihiro Matz Matsumoto 3eeef30618 make mrb_hash_keys() non static function 2012-11-14 14:42:21 +09:00
Yukihiro Matz Matsumoto d2d2e9f5f9 add new predicates mrb_string_p(),mrb_array_p(),mrb_hash_p() 2012-11-04 05:02:39 +09:00
Yukihiro Matsumoto 18fbe4d0b7 do not touch h from Hash when h might be NULL 2012-10-23 14:16:14 +09:00
Masamitsu MURASE 42fa994e9b Publish mrb_hash_delete_key. 2012-08-26 04:17:56 +09:00
Masaki Muranaka 22b032fcdf mrb_hash_delete_key(), mrb_hash_keys() : Declare as static.
mrb_check_hash_type(): Remove as no implementation.
2012-07-29 20:11:43 +09:00
Masaki Muranaka b2fc62f3a9 Remove commented out code. 2012-07-29 15:25:14 +09:00
Masamitsu MURASE b48cfea736 Protect deleted key and value from GC. 2012-07-28 21:10:57 +09:00
Junji Sawada 96366117ea Remove unnecessary header inclusion 2012-07-14 11:39:25 +09:00
Yukihiro Matsumoto 48c73ac630 less <stdio.h> 2012-07-13 10:13:47 +09:00