ctx_parser 0.2.3 → 0.2.4

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: c642815fd4891349acb98052cf1601b9b69217f4025db17d02c64705506eca12
4
- data.tar.gz: 91e34bd39b1116a3228c9653dd51322bc0ac8d47dec25e3fcf94a41af947ed92
3
+ metadata.gz: 19faa09b189e01bb0d76ad334a769bebe9c54fb2cc05bea40e335f81f02d2764
4
+ data.tar.gz: 1484eafe0166f0141d7dfdf3709364ef7cea19dca5cc56c4e2356711504f2876
5
5
  SHA512:
6
- metadata.gz: 9cd537e0188eda9578bfb03e5a1cc26d703a62da5bbd1cbc2beb4fcce66233ab03de5959f20cc9821b7780ab5a2c4edc764fa063cc8afb5ca7148cf9ffd6f955
7
- data.tar.gz: '022948b2a66b03ba946c748cf5aaf5dfca9eff72710f859147e8c69e195de7e1b7f055eff54c21e28eb83d763ce3c1128520c726ae3eabd655fa0f943cc91b88'
6
+ metadata.gz: 8bbc87c894cfe9c6db52ebcacbce0c0ceda4c1e979a670d2c63b7b2f80402bc91a8afa83987b3b3945c4c2e02481ffea80cf7b9bc9dfc6704489afbd2f196a17
7
+ data.tar.gz: 4d387bb4fb40ed03cd08b719064c33fa88978cccc1274d46236bc8b4a965cf07aa18aceab92f5f37d9cbce571852f202ad5fa08de532d98ea2f8fc082230c891
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  Changes to the public contract are recorded here. Versions follow Semantic Versioning.
4
4
 
5
+ ## 0.2.4 (2026-10-18)
6
+
7
+ - Clear Bundler bootstrap variables when verifying packages in an isolated gem installation, including calls made through bundle exec.
8
+
9
+ - Reduce temporary grouping allocations in Records while preserving callback counts, identity equality, record ownership and selection order.
10
+
5
11
  ## 0.2.3 (2026-10-18)
6
12
 
7
13
  - Redact Result, Results and Line during pretty printing, including nested containers.
@@ -16,11 +16,23 @@ module CtxParser
16
16
  raise ArgumentError, "Identity must be a nonempty array or callable" unless identity_key
17
17
 
18
18
  @rows = rows.dup.freeze
19
- identity_groups = @rows.group_by { |row| identity_key.call(row) }.values
20
- @first_occurrences = identity_groups.map(&:first).freeze
21
- @unambiguous = identity_groups.filter_map { |group| group.first if group.one? }.freeze
22
- @duplicate_identity_count = identity_groups.count { |group| group.size > 1 }
23
- @duplicate_row_count = @rows.size - identity_groups.size
19
+ positions = {}
20
+ first_occurrences, unambiguous = [], []
21
+ @duplicate_identity_count = 0
22
+ @rows.each do |row|
23
+ key = identity_key.call(row)
24
+ if (position = positions[key])
25
+ @duplicate_identity_count += 1 if unambiguous[position]
26
+ unambiguous[position] = nil
27
+ else
28
+ positions[key] = first_occurrences.size
29
+ first_occurrences << row
30
+ unambiguous << row
31
+ end
32
+ end
33
+ @first_occurrences = first_occurrences.freeze
34
+ @unambiguous = unambiguous.compact.freeze
35
+ @duplicate_row_count = @rows.size - first_occurrences.size
24
36
  freeze
25
37
  end
26
38
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module CtxParser
4
4
  # 公开包版本,供 RubyGems 元数据和运行时调用方共用。
5
- VERSION = "0.2.3"
5
+ VERSION = "0.2.4"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ctx_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gatework contributors