From 2792ab56e70241ef50e873dc717ed5fb6a9a1e24 Mon Sep 17 00:00:00 2001 From: Denislav Naydenov Date: Tue, 19 Dec 2023 17:24:14 +0200 Subject: [PATCH] freeze offset format string --- lib/combine_pdf/pdf_public.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/combine_pdf/pdf_public.rb b/lib/combine_pdf/pdf_public.rb index 43c564b..b4c910e 100644 --- a/lib/combine_pdf/pdf_public.rb +++ b/lib/combine_pdf/pdf_public.rb @@ -207,7 +207,7 @@ def to_pdf(options = {}) # xref_location = 0 # out.each { |line| xref_location += line.bytesize + 1} out << "xref\n0 #{indirect_object_count}\n0000000000 65535 f " - xref.each { |offset| out << ("%010d 00000 n " % offset) } + xref.each { |offset| out << ("%010d 00000 n ".freeze % offset) } out << 'trailer'.freeze out << "<<\n/Root #{false || "#{catalog[:indirect_reference_id]} #{catalog[:indirect_generation_number]} R"}" out << "/Size #{indirect_object_count}"