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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f86731ba5f2e4528ab41956da7c996a5a61f29a
4
- data.tar.gz: 2b854bd72110dfde1e538a383e0c5fa9800374a8
3
+ metadata.gz: 07a8361617b376ebc2b0b54743d430ddaa62a2f6
4
+ data.tar.gz: 2e88b6106deb2cf8087e527368477c9330d6e0c7
5
5
  SHA512:
6
- metadata.gz: aa9378db54dd9579c02767b0be50c0c78923207965b41c67ddb9713a15aa4a48c0b3ce24fd2e769082d09899dae0421e40e1d5118ce93a85f7f9e081645af120
7
- data.tar.gz: b48d6775d5cf620f455e9c78f961e00aab1fb78a1aa6f8d6d3cf56ef668af6ce1628e99cdf99b1d0c9fda82dd1d1605ac36e106caa0169a7b3574f8953b3fae4
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
@@ -1,3 +1,3 @@
1
1
  module PatronusFati
2
- VERSION = '1.3.1'
2
+ VERSION = '1.3.2'
3
3
  end
@@ -44,6 +44,17 @@ RSpec.describe(PatronusFati::BitHelper) do
44
44
  "0000000000000000"
45
45
  ],
46
46
  answer: 16
47
+ },
48
+ {
49
+ bit_strings: [],
50
+ answer: 0
51
+ },
52
+ {
53
+ bit_strings: [
54
+ "0000000011111111",
55
+ "1111111100000000"
56
+ ],
57
+ answer: 0
47
58
  }
48
59
  ]
49
60
  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.1
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-10-25 00:00:00.000000000 Z
11
+ date: 2017-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: louis