rbtree3 0.6.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +19 -0
- data/rbtree.c +4 -8
- data/test.rb +2 -2
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e58d214b8c7a56e628ff7783e9f8ee40088fd78a3be0f719ee8f1125017d2d28
|
4
|
+
data.tar.gz: 29f619a21052915efd058701b2fb334f983066ac35b6c370b73208b6bdd8fe9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e203ace7dad74d26d9df1d8776cbce09d9db8c15ab8d1cdc4ef822314346c595d851d0341c1c5a34a630d386959da4bac54b5b62b3e7d9a2789be7e78cbfae38
|
7
|
+
data.tar.gz: 53dfea3812a02aa104aee2f07fa5dd1504d58e7427e4ee5e581903472362a7d1f0147b92ca753b625ee344a4ac7435d8a4dc2eba7ab9c50060317f82fedb599c
|
data/ChangeLog
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
2023-04-20 Tsimnuj Hawj
|
2
|
+
|
3
|
+
* version 0.7.1 released.
|
4
|
+
|
5
|
+
* rbtree.c: (rbtree_cmp): compilation fixes for Apple M1 chips (and newer)
|
6
|
+
|
7
|
+
2022-01-10 Kyrylo Silin
|
8
|
+
|
9
|
+
* version 0.7.0 released.
|
10
|
+
|
11
|
+
* started testing against Ruby 3.0, 3.1 and Ruby head
|
12
|
+
|
13
|
+
* test.rb: fixed duplicate test names
|
14
|
+
|
15
|
+
* rbtree.c: deleted deprecated rb_gc_force_recycle calls
|
16
|
+
|
17
|
+
* rbtree.c: (Init_rbtree): MultiRBTree inherits from rb_cObject instead of
|
18
|
+
rb_cData, which fixed a compilation error on Ruby 3.1+
|
19
|
+
|
1
20
|
2020-01-21 Brian Hawley
|
2
21
|
|
3
22
|
* version 0.6.0 released.
|
data/rbtree.c
CHANGED
@@ -122,7 +122,7 @@ static int
|
|
122
122
|
rbtree_cmp(const void* key1, const void* key2, void* context)
|
123
123
|
{
|
124
124
|
VALUE ret;
|
125
|
-
if (TYPE(key1) == T_STRING && TYPE(key2) == T_STRING)
|
125
|
+
if (TYPE((VALUE)key1) == T_STRING && TYPE((VALUE)key2) == T_STRING)
|
126
126
|
return rb_str_cmp((VALUE)key1, (VALUE)key2);
|
127
127
|
ret = rb_funcall((VALUE)key1, id_cmp, 1, (VALUE)key2);
|
128
128
|
return cmpint(ret, (VALUE)key1, (VALUE)key2);
|
@@ -301,7 +301,7 @@ insert_node_ensure(VALUE arg_)
|
|
301
301
|
dict->dict_freenode(node, dict->dict_context);
|
302
302
|
break;
|
303
303
|
case NODE_NOT_FOUND:
|
304
|
-
if (TYPE(arg->key) == T_STRING)
|
304
|
+
if (TYPE((VALUE)arg->key) == T_STRING)
|
305
305
|
node->dict_key = TO_KEY(rb_str_new4(GET_KEY(node)));
|
306
306
|
break;
|
307
307
|
case NODE_FOUND:
|
@@ -377,7 +377,7 @@ rbtree_fetch(int argc, VALUE* argv, VALUE self)
|
|
377
377
|
rbtree_argc_error();
|
378
378
|
block_given = rb_block_given_p();
|
379
379
|
if (block_given && argc == 2)
|
380
|
-
|
380
|
+
rb_warn("block supersedes default value argument");
|
381
381
|
|
382
382
|
node = dict_lookup(DICT(self), TO_KEY(argv[0]));
|
383
383
|
if (node != NULL)
|
@@ -665,8 +665,6 @@ copy_dict(VALUE src, VALUE dest, dict_comp_t cmp, void* context)
|
|
665
665
|
DICT(temp) = DICT(dest);
|
666
666
|
DICT(dest) = t;
|
667
667
|
}
|
668
|
-
rbtree_free(RBTREE(temp));
|
669
|
-
rb_gc_force_recycle(temp);
|
670
668
|
}
|
671
669
|
|
672
670
|
/*
|
@@ -1575,7 +1573,6 @@ rbtree_dump(VALUE self, VALUE _limit)
|
|
1575
1573
|
|
1576
1574
|
ret = rb_marshal_dump(ary, Qnil);
|
1577
1575
|
rb_ary_clear(ary);
|
1578
|
-
rb_gc_force_recycle(ary);
|
1579
1576
|
return ret;
|
1580
1577
|
}
|
1581
1578
|
|
@@ -1596,7 +1593,6 @@ rbtree_s_load(VALUE klass, VALUE str)
|
|
1596
1593
|
IFNONE(rbtree) = ptr[len];
|
1597
1594
|
|
1598
1595
|
rb_ary_clear(ary);
|
1599
|
-
rb_gc_force_recycle(ary);
|
1600
1596
|
return rbtree;
|
1601
1597
|
}
|
1602
1598
|
|
@@ -1656,7 +1652,7 @@ rbtree_s_load(VALUE klass, VALUE str)
|
|
1656
1652
|
*/
|
1657
1653
|
void Init_rbtree()
|
1658
1654
|
{
|
1659
|
-
MultiRBTree = rb_define_class("MultiRBTree",
|
1655
|
+
MultiRBTree = rb_define_class("MultiRBTree", rb_cObject);
|
1660
1656
|
RBTree = rb_define_class("RBTree", MultiRBTree);
|
1661
1657
|
|
1662
1658
|
rb_include_module(MultiRBTree, rb_mEnumerable);
|
data/test.rb
CHANGED
@@ -701,7 +701,7 @@ class RBTreeTest < Test::Unit::TestCase
|
|
701
701
|
end
|
702
702
|
end
|
703
703
|
|
704
|
-
def
|
704
|
+
def test_marshal_dump
|
705
705
|
assert_equal(@rbtree, Marshal.load(Marshal.dump(@rbtree)))
|
706
706
|
|
707
707
|
@rbtree.default = "e"
|
@@ -890,7 +890,7 @@ class MultiRBTreeTest < Test::Unit::TestCase
|
|
890
890
|
assert_equal(%w(c C b B b C b D a A), @rbtree.to_a.flatten)
|
891
891
|
end
|
892
892
|
|
893
|
-
def
|
893
|
+
def test_marshal_dump_load
|
894
894
|
assert_equal(@rbtree, Marshal.load(Marshal.dump(@rbtree)))
|
895
895
|
end
|
896
896
|
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbtree3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyrylo Silin
|
8
8
|
- OZAWA Takuma
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-04-20 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: |-
|
15
15
|
A RBTree is a sorted associative collection that is implemented with a Red-Black Tree. It maps keys to values like a Hash, but maintains its elements in ascending key order. The interface is the almost identical to that of Hash.
|
@@ -39,7 +39,7 @@ metadata:
|
|
39
39
|
homepage_uri: https://github.com/kyrylo/rbtree3
|
40
40
|
source_code_uri: https://github.com/kyrylo/rbtree3
|
41
41
|
changelog_uri: https://github.com/kyrylo/rbtree3/blob/master/ChangeLog
|
42
|
-
post_install_message:
|
42
|
+
post_install_message:
|
43
43
|
rdoc_options: []
|
44
44
|
require_paths:
|
45
45
|
- "./"
|
@@ -54,9 +54,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
requirements: []
|
57
|
-
|
58
|
-
|
59
|
-
signing_key:
|
57
|
+
rubygems_version: 3.4.1
|
58
|
+
signing_key:
|
60
59
|
specification_version: 4
|
61
60
|
summary: A RBTree is a sorted associative collection that is implemented with a Red-Black
|
62
61
|
Tree.
|