cdb-ruby 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cdb/reader.rb +3 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1568b9d3e0a0c612b8f90b0a8ec85f5762f72d44
|
4
|
+
data.tar.gz: 366fb91e7f118e7840a8adac941a6d5b03eff436
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 521545ffd0fc76312a2bb6a036893565791242eddb887fd38468602def95a08852a1bbcedd38a0e72575aff5a4dfdbba029809cf7dc274e1540520b37a00e110
|
7
|
+
data.tar.gz: 275a44e9088a6cdaa906828e43e31feea1930e076a376a1317a8b03cfe4097dab0a863d80279c744bd9ed6f013b9953196afecf9a4a298b76977e4d296fb726f
|
data/lib/cdb/reader.rb
CHANGED
@@ -18,13 +18,12 @@ module Cdb
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def key_from_table(table, key, hash)
|
21
|
-
|
22
|
-
|
23
|
-
entry_hash, offset = table[
|
21
|
+
initial = (hash / Cdb::NUM_HASHTABLES) % table.length
|
22
|
+
(0...table.length).each do |n|
|
23
|
+
entry_hash, offset = table[(initial + n) % table.length]
|
24
24
|
return nil if offset.zero?
|
25
25
|
value = maybe_read_value(offset, key) if entry_hash == hash
|
26
26
|
return value unless value.nil?
|
27
|
-
index = (index + 1) % table.length
|
28
27
|
end
|
29
28
|
end
|
30
29
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cdb-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Olly Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: olly.smith@gmail.com
|