patronus_fati 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/patronus_fati/bit_helper.rb +3 -1
- data/lib/patronus_fati/version.rb +1 -1
- data/spec/patronus_fati/bit_helper_spec.rb +11 -0
- 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: 07a8361617b376ebc2b0b54743d430ddaa62a2f6
|
4
|
+
data.tar.gz: 2e88b6106deb2cf8087e527368477c9330d6e0c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9eef73a1f7ae40c591a5c6b1b0ce5a683da3e5f6501f21bd4d8cb8f28a216c749b0a46ba4cba0dc2fe45657676ba88c83c988ca5382f07041a8c107ea877f68a
|
7
|
+
data.tar.gz: c7ef5813938f605a3a28a26fcea6f4ddec545cb4f1de36eefe34d076985851ba0d8ad4e81aa0d1f0924622b48ea2560aebec26a56e4922bcdcbd2aeb789ce7f9
|
@@ -39,6 +39,8 @@ module PatronusFati
|
|
39
39
|
# case assuming it's broadcasting multiple is likely fine for these kinds
|
40
40
|
# of floods).
|
41
41
|
#
|
42
|
+
# In the case that there is no overlap this will return 0.
|
43
|
+
#
|
42
44
|
# @param [Array<Fixnum>] bit_list
|
43
45
|
# @return [Boolean]
|
44
46
|
def self.largest_bit_overlap(bit_list)
|
@@ -50,7 +52,7 @@ module PatronusFati
|
|
50
52
|
reference = bit_list[(i + 1)..-1].inject { |ref, bits| ref | bits }
|
51
53
|
# Find the common bits between the reference and this bit string
|
52
54
|
count_consecutive_bits(reference & bits)
|
53
|
-
end.max
|
55
|
+
end.push(0).max
|
54
56
|
end
|
55
57
|
end
|
56
58
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: patronus_fati
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Stelfox
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: louis
|