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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/ctx_parser/records.rb +17 -5
- data/lib/ctx_parser/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 19faa09b189e01bb0d76ad334a769bebe9c54fb2cc05bea40e335f81f02d2764
|
|
4
|
+
data.tar.gz: 1484eafe0166f0141d7dfdf3709364ef7cea19dca5cc56c4e2356711504f2876
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
data/lib/ctx_parser/records.rb
CHANGED
|
@@ -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
|
-
|
|
20
|
-
|
|
21
|
-
@
|
|
22
|
-
@
|
|
23
|
-
|
|
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
|
|
data/lib/ctx_parser/version.rb
CHANGED