lutaml-model 0.8.79 → 0.8.80

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: baaf76af5592d1f15c959d624311b2275e3871728b7c74ca416032c743929134
4
- data.tar.gz: cc5bc7a1cea2b151c51f720f971c8799d1d005e4ef7fc79fa415e611e161a2b5
3
+ metadata.gz: 8375b9ceb21e41c8f236b2e96728983065a6b547f31401686ab5b9b520db2d8d
4
+ data.tar.gz: 3e9f7da096049d3cf0472a18782f014341df12b8ae0e0394dcab18a24de73c9b
5
5
  SHA512:
6
- metadata.gz: 68ab1cf58c777ef8f508c9c3e10df0026ea2de6affb69fa76f8c25e262dfdce8cdd5d67caccb7672eedeea233a654c5e3cd1c5c16ed3c7a4688f02937e46c897
7
- data.tar.gz: 53b98253d7946438a13ac912701a271aa32f549525ca17b0645243a2669631dc79ee728928ee808e9a7660c0f3bbd2e963d3cdcc17b70f2adb2419aab68e8904
6
+ metadata.gz: 8c925f539d5fdb6ca0e57dae30b6e3b4fe8ed162fbfdb8dc66f04661c885399eefdd99259a7f3067b9a98cab678fb6b9b3d5176418e6d80c7d2ec2b58eea86aa
7
+ data.tar.gz: 8673fafc5fc984374916bf509e855ce69dcfd89134149d9e348b7f56eede5b95b6e4e0eca064c1cc0dfdcb169aecf27b47a75251a4cd3dc7c356c92ef05da317
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lutaml
4
4
  module Model
5
- VERSION = "0.8.79"
5
+ VERSION = "0.8.80"
6
6
  end
7
7
  end
@@ -107,7 +107,9 @@ module Lutaml
107
107
  kwargs = {}
108
108
  children = []
109
109
  delegates = []
110
- spellings = Hash.new { |h, k| h[k] = [] }
110
+ # Lazy: models without multi-spelling rows never touch it, and
111
+ # the block-backed Hash is a fresh object per hydrated row.
112
+ spellings = nil
111
113
  row_tags = plan[:row_tags]
112
114
  plan[:rows].each_with_index do |(rule, attr, kind, spelling, delegate), idx|
113
115
  tag = row_tags&.[](idx)
@@ -174,6 +176,7 @@ module Lutaml
174
176
  assign(kwargs, delegates, delegate, rule, attr, values)
175
177
  end
176
178
  when :spelling
179
+ spellings ||= Hash.new { |h, k| h[k] = [] }
177
180
  spellings[[rule, attr]] << grouped[spelling.to_s].to_a
178
181
  when :nested
179
182
  child_type = attr.type(register)
@@ -193,7 +196,7 @@ module Lutaml
193
196
  attr.collection? ? items : items.first)
194
197
  end
195
198
  end
196
- unless spellings.empty?
199
+ unless !spellings || spellings.empty?
197
200
  spellings.each do |(rule, attr), groups|
198
201
  # Interpretive order for shared-attribute groups is
199
202
  # spelling-group order (first spelling's matches, then
@@ -397,8 +400,8 @@ module Lutaml
397
400
 
398
401
  def group_children(value, row_tags = nil)
399
402
  grouped = {}
400
- tagged = {}
401
403
  want_tags = !row_tags.nil?
404
+ tagged = want_tags ? {} : nil
402
405
  value.count.times do |i|
403
406
  child = value.at(i)
404
407
  # One FFI crossing per child: the name was read twice here
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lutaml-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.79
4
+ version: 0.8.80
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.