canon 0.3.0 → 0.3.1

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: 0d1f4de27225e068e0bc1a00b2b7b2d980847bf9027a21f042de148aae65926e
4
- data.tar.gz: 4561eaa1efb9abcd541ec8da05f2e33df11859c35d6e5fe3f5fee9fa9d22af3d
3
+ metadata.gz: 8180c4d10ad157f5fd7d401d7c4723a70d53daa90894a43c33016253d0355093
4
+ data.tar.gz: 513538a92c8f209b2eeec7ecf2adedf9e2a86de8e2c6c0e807b45522afffa9b3
5
5
  SHA512:
6
- metadata.gz: ee29ec80689f0c53771017dca13d48ba4c3162db98f0e3605c3198148035cd564d818b8e4c08728608ef3abd055231d82850f79f933d2206ec4a36d488c6faa6
7
- data.tar.gz: 37ae2bd7e928265b8c54e4025ae73d7e8761ce6e28ee2933e005129bd218d7003a5d547103bba140e11e829ef4d45aa7ef41768766b302f6608814f08fb74983
6
+ metadata.gz: 15bbb37c41f2fe0809be3a1ae9e6e3bf438d7d509eb478b92eb1ace044d511017a257409024c0c7e042bf5dc146af0dbbfc9397c6ffea13a5d410fb9019c716d
7
+ data.tar.gz: 81c275d67d47bfeb87a1c5969e90643da41e8816e882a40fa5affa8337fbd3c5bd0ee82428ef63b36bc5dff8338776e8df4da53394d3319663f3167433664785
data/lib/canon/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Canon
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
@@ -261,7 +261,7 @@ preserve_whitespace: false)
261
261
  # --- Moxml path ---
262
262
 
263
263
  def self.from_moxml_xml(xml_string, preserve_whitespace:)
264
- doc = Canon::XmlParsing.parse(xml_string)
264
+ doc = Canon::XmlParsing.moxml_context.parse(xml_string, readonly: true)
265
265
  check_moxml_relative_namespace_uris(doc)
266
266
  result = build_from_moxml(doc, preserve_whitespace: preserve_whitespace)
267
267
  # Canon owns this document's full lifecycle: the canon tree holds
@@ -390,11 +390,11 @@ preserve_whitespace: false)
390
390
  ))
391
391
  end
392
392
 
393
- # Adopt completed children (they stack in reverse: unshift
394
- # restores document order).
393
+ # Adopt completed children: they pop in reverse order; reversing
394
+ # once is O(n) (unshift per child would be O(n^2) on wide trees).
395
395
  children = []
396
- children.unshift(frames.pop[1]) while frames.any? && frames.last[0] > record[:depth]
397
- children.each { |child| element.add_child(child) }
396
+ children << frames.pop[1] while frames.any? && frames.last[0] > record[:depth]
397
+ children.reverse_each { |child| element.add_child(child) }
398
398
 
399
399
  own_namespaces[element] = record[:namespaces]
400
400
  element
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.