foobara-util 1.0.4 → 1.0.5

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
  SHA256:
3
- metadata.gz: dfa3f65a13306f37f57d39d0bcf7cbebc98cb9e580c6ee8b562744f5cb3091f9
4
- data.tar.gz: 5e9e6cb4a398fbcd9386a79932e30a5d0d4f1c48cbf228cca0189b29c17c5d8b
3
+ metadata.gz: 2804f3c80131811275793b6f336f800694a9df0a51c6ddb15f8e2af89ba706fa
4
+ data.tar.gz: 88d31a549377ad420cd9b338264845ca46809e4b84f6b8f62a9b9725d5af3861
5
5
  SHA512:
6
- metadata.gz: d2f56dd4ca2a33e244375c12aa9b2a2e09e8e78c1c5102123f2897340333cd7b8934dd12a0fe9e6722ba110f331154a2169c8e7417cde5fcc1791b78cfc9e2d4
7
- data.tar.gz: a68d604c7e20ca081fb67ae1208fe2b22b6de28146b8f9685678dc0ddb6e8b04d30761769b284f16aceca262cff4323f78b8a077e35d98c40c93a25ad31ad192
6
+ metadata.gz: 2567f5588d89b2dc4eae8e7197b14e91556a2aaacce385fa65ebb0f9a20c86b78902b18ae37825d85da57279fdf1f63aa3860b122ef4414e526b134d623c4586
7
+ data.tar.gz: 6e10efe461c1e7e1bd5698087cca6885a6bd7e449046b94e38e046ac0b3cd7bed4b3ab2d21c140c5058af83b04b24d19dcac2e2cad4b36fdf271441b7de0986a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [1.0.5] - 2025-12-12
2
+
3
+ - Add EMPTY_ARRAY frozen constant for use to avoid some allocation/garbage collection
4
+
1
5
  ## [1.0.4] - 2025-11-01
2
6
 
3
7
  - Add .referencing_paths to help debugging finding what object is referencing another
@@ -1,9 +1,11 @@
1
+ require_relative "constants"
2
+
1
3
  module Foobara
2
4
  module Util
3
5
  module_function
4
6
 
5
7
  def power_set(array)
6
- return [[]] if array.empty?
8
+ return [EMPTY_ARRAY] if array.empty?
7
9
 
8
10
  head, *tail = array
9
11
  subsets = power_set(tail)
@@ -0,0 +1,3 @@
1
+ module Foobara
2
+ EMPTY_ARRAY = [].freeze
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
@@ -25,6 +25,7 @@ files:
25
25
  - lib/foobara/util/args.rb
26
26
  - lib/foobara/util/array.rb
27
27
  - lib/foobara/util/class.rb
28
+ - lib/foobara/util/constants.rb
28
29
  - lib/foobara/util/hash.rb
29
30
  - lib/foobara/util/meta.rb
30
31
  - lib/foobara/util/module.rb