sorted_containers 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/README.md +11 -1
- data/lib/sorted_containers/sorted_array.rb +2 -4
- data/lib/sorted_containers/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79ae63c0d79d80ddc1ae621638b598673c2aca5732277582dedcf58c58be89c4
|
4
|
+
data.tar.gz: d6b9be454ce395905449ec323a115e89a9319237dc62a96b70568e061a7a6906
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4faf2986fae2b98c40f8bc58797b437e023c342504bbe0fdcc364b0dd922708030b63bfb979e256794b6f9b9c345d0b0eafb5835561e21b1c1076ef28893a500
|
7
|
+
data.tar.gz: a80d3cbfe66ca19bf137b835684d4162c9ac665641fe70e6e1a2ce1c86a825ad69f0180e48aa65a642b016f133cb9c922aa6e9d5c9da2b8c3c5123646b8948b5
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,17 @@
|
|
4
4
|
|
5
5
|
[](https://badge.fury.io/rb/sorted_containers)
|
6
6
|
|
7
|
-
SortedContainers is a fast implementation of sorted arrays, sets, and hashes in pure Ruby.
|
7
|
+
SortedContainers is a fast implementation of sorted arrays, sets, and hashes in pure Ruby.
|
8
|
+
|
9
|
+
- SortedArray, SortedSet, and SortedHash
|
10
|
+
- Pure Ruby
|
11
|
+
- Fast Performance
|
12
|
+
- (almost) Identical API to Array, Set, and Hash
|
13
|
+
- No dependencies
|
14
|
+
- Benchmarks
|
15
|
+
- Unit Tested
|
16
|
+
|
17
|
+
This library is based on the [sortedcontainers](https://grantjenks.com/docs/sortedcontainers/) Python library by Grant Jenks.
|
8
18
|
|
9
19
|
SortedContainers provides three main classes: `SortedArray`, `SortedSet`, and `SortedHash`. Each class is a drop-in replacement for the corresponding Ruby class, but with the added benefit of maintaining the elements in sorted order.
|
10
20
|
|
@@ -355,9 +355,7 @@ module SortedContainers
|
|
355
355
|
def bsearch_index(&block)
|
356
356
|
return nil if @maxes.empty?
|
357
357
|
|
358
|
-
pos = @maxes.bsearch_index(&block)
|
359
|
-
|
360
|
-
return nil if pos.nil?
|
358
|
+
pos = @maxes.bsearch_index(&block) || 0
|
361
359
|
|
362
360
|
idx = @lists[pos].bsearch_index(&block)
|
363
361
|
loc(pos, idx)
|
@@ -1384,7 +1382,7 @@ module SortedContainers
|
|
1384
1382
|
pos += 1 if pos.zero?
|
1385
1383
|
|
1386
1384
|
prev = pos - 1
|
1387
|
-
@lists[prev].concat(
|
1385
|
+
@lists[prev].concat(@lists[pos])
|
1388
1386
|
@maxes[prev] = @lists[prev].last
|
1389
1387
|
|
1390
1388
|
@lists.delete_at(pos)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sorted_containers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garrison Jensen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A collection of sorted containers including SortedArray, SortedDict,
|
14
14
|
and SortedSet.
|
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '0'
|
58
58
|
requirements: []
|
59
|
-
rubygems_version: 3.5.
|
59
|
+
rubygems_version: 3.5.16
|
60
60
|
signing_key:
|
61
61
|
specification_version: 4
|
62
62
|
summary: A collection of sorted containers including SortedArray, SortedDict, and
|