From def68d226225a4501131adc69fc1de577555637a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Bu=CC=88nemann?= Date: Sat, 28 Dec 2024 20:15:32 +0100 Subject: [PATCH] Remove useless use of freeze --- lib/xlsxtream/xml.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/xlsxtream/xml.rb b/lib/xlsxtream/xml.rb index b175049..13e4859 100644 --- a/lib/xlsxtream/xml.rb +++ b/lib/xlsxtream/xml.rb @@ -9,22 +9,22 @@ module XML }.freeze # Escape first underscore of ST_Xstring sequences in input strings to appear as plaintext in Excel - HEX_ESCAPE_REGEXP = /_(x[0-9A-Fa-f]{4}_)/.freeze - XML_ESCAPE_UNDERSCORE = '_x005f_\1'.freeze + HEX_ESCAPE_REGEXP = /_(x[0-9A-Fa-f]{4}_)/ + XML_ESCAPE_UNDERSCORE = '_x005f_\1' - XML_DECLARATION = %'\r\n'.freeze + XML_DECLARATION = %'\r\n' - WS_AROUND_TAGS = /(?<=>)\s+|\s+(?=<)/.freeze + WS_AROUND_TAGS = /(?<=>)\s+|\s+(?=<)/ - UNSAFE_ATTR_CHARS = /[&"<>]/.freeze - UNSAFE_VALUE_CHARS = /[&<>]/.freeze + UNSAFE_ATTR_CHARS = /[&"<>]/ + UNSAFE_VALUE_CHARS = /[&<>]/ # http://www.w3.org/TR/REC-xml/#NT-Char: # Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] - INVALID_XML10_CHARS = /[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}]/.freeze + INVALID_XML10_CHARS = /[^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}]/ # ST_Xstring escaping - ESCAPE_CHAR = lambda { |c| '_x%04X_'.freeze % c.ord }.freeze + ESCAPE_CHAR = lambda { |c| '_x%04X_' % c.ord } class << self @@ -33,7 +33,7 @@ def header end def strip(xml) - xml.gsub(WS_AROUND_TAGS, ''.freeze) + xml.gsub(WS_AROUND_TAGS, '') end def escape_attr(string)