hyperll 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82af95ec5cf82a356d3b5c1252c089509fa08193
4
- data.tar.gz: d46c3121f220ad661fa1c4a6a6abaf3e31800726
3
+ metadata.gz: 078a9aafd86d9c1ffa575e83b0ed2826a5605afa
4
+ data.tar.gz: 174892051165cea609a7b77476adb88afad2cd1a
5
5
  SHA512:
6
- metadata.gz: 91892e69eb09d3c41450b32e8f52112597190dd1f0664d762e477d33e7506ecac40b519d2f541d4c965402885839f122fab75eb40f4466bd273002bc7fe84da7
7
- data.tar.gz: 0858d530e8520ee1765edccbac24c71d33777a24dacea7a19a1428a7eef54f2e3640e9ffba578874cba619d2bcd2375f9d41e655ea3cefce61c4511684a9b662
6
+ metadata.gz: ac15ed412c66ab1bd72e7cc71c0ba57ba85ee410c333a3fc71e4e624d6b9046a3dccd106a86354245668400f492c8f09762bdbf9e902a63665568965f41f8771
7
+ data.tar.gz: 003a2c5236fd3b94a02a5fa0d3dce615b04feb5ea2c04f21aa34663200d607196b0112fce34bf759f8c93323934938f5d1df46da5fc4eb3eda039c63a5fa8820
@@ -125,6 +125,7 @@ module Hyperll
125
125
 
126
126
  if sp > 0
127
127
  @sparse_count = 2 ** sp
128
+ @sparse_set_threshold = 0.75 * @count
128
129
  @sparse_set = sparse_set || []
129
130
  end
130
131
 
@@ -157,6 +158,7 @@ module Hyperll
157
158
  case [format, other.format]
158
159
  when [:sparse, :sparse]
159
160
  @sparse_set = merge_sparse_set(other.sparse_set)
161
+ convert_to_normal_if_above_sparse_threshold
160
162
  when [:normal, :normal]
161
163
  @register_set.merge(other.register_set)
162
164
  when [:sparse, :normal]
@@ -186,6 +188,10 @@ module Hyperll
186
188
  self
187
189
  end
188
190
 
191
+ def convert_to_normal_if_above_sparse_threshold
192
+ convert_to_normal if @sparse_set.length > @sparse_set_threshold
193
+ end
194
+
189
195
  def serialize
190
196
  str = ""
191
197
  str << [-2].pack("N") # -VERSION
@@ -1,3 +1,3 @@
1
1
  module Hyperll
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyperll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Lindeman