concurrent-ruby 1.2.1 → 1.2.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
  SHA256:
3
- metadata.gz: 366b0c4f0d3184143a58a6b30538fe9997e7dfad19c8ea38a468168d680f3bdf
4
- data.tar.gz: 010f0ee92f5132a2ed41da7d789a72955691dbcf880c579fd121cb366ba000bc
3
+ metadata.gz: 1cad803df2c0fe187f3208dce2972feaa94daefcbd3749770abe3abfc0642fe9
4
+ data.tar.gz: 216b0196496fde70f53cc82b83cd593ec5267a53dcac9a312f254ae627f7761e
5
5
  SHA512:
6
- metadata.gz: 876b3302b218236cb89bd838e3030e2c5937d9682edd8e88a47d538ec5f0da21a7d49b55452e278e6c01b7210cb51c4bad3afc6b5767294f16890f5bd630e69b
7
- data.tar.gz: 938906cad82d61617a0267dc28dc99e18420c7872593344c1c6adb4fa54c751839226703e1ce6ea81e79dcd35b2650e5868c6c11bcaf83c02d2fb105aa8b35a2
6
+ metadata.gz: 605762fd9c26a5a783dcb834f9db5d818ba2b52431b382a7abd33aaddfcc0df8c5005abf0e1a7ebacf3aced9ebb61ee7080fd59050805422f4fc5593925ae935
7
+ data.tar.gz: ae916f03459f583497ab268aa82cc79d24dcddb2c51a86abf86313ad77faf975d10d22048ca03179c6583832fc0e25f3f3c1618de0668f9a2774486d7e15e41c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## Current
2
2
 
3
+ ## Release v1.2.2 (24 Feb 2023)
4
+
5
+ * (#993) Fix arguments passed to `Concurrent::Map`'s `default_proc`.
6
+
7
+ ## Release v1.2.1 (24 Feb 2023)
8
+
3
9
  * (#990) Add missing `require 'fiber'` for `FiberLocalVar`.
4
10
  * (#989) Optimize `Concurrent::Map#[]` on CRuby by letting the backing Hash handle the `default_proc`.
5
11
 
@@ -14,7 +14,7 @@ module Concurrent
14
14
  # reasons.
15
15
  def initialize(options = nil, &default_proc)
16
16
  validate_options_hash!(options) if options.kind_of?(::Hash)
17
- @backend = Hash.new(&default_proc)
17
+ set_backend(default_proc)
18
18
  @default_proc = default_proc
19
19
  end
20
20
 
@@ -113,9 +113,17 @@ module Concurrent
113
113
 
114
114
  private
115
115
 
116
+ def set_backend(default_proc)
117
+ if default_proc
118
+ @backend = ::Hash.new { |_h, key| default_proc.call(self, key) }
119
+ else
120
+ @backend = {}
121
+ end
122
+ end
123
+
116
124
  def initialize_copy(other)
117
125
  super
118
- @backend = Hash.new(&@default_proc)
126
+ set_backend(@default_proc)
119
127
  self
120
128
  end
121
129
 
@@ -1,3 +1,3 @@
1
1
  module Concurrent
2
- VERSION = '1.2.1'
2
+ VERSION = '1.2.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concurrent-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jerry D'Antonio