Skip to content

Feature/fix frozen strings#43

Merged
janfri merged 3 commits intojanfri:masterfrom
prtngn:feature/fix_frozen_strings
Dec 22, 2023
Merged

Feature/fix frozen strings#43
janfri merged 3 commits intojanfri:masterfrom
prtngn:feature/fix_frozen_strings

Conversation

@prtngn
Copy link
Copy Markdown

@prtngn prtngn commented Oct 25, 2023

Hi. I have a problem with frozen strings. This is PR fix it.

@janfri
Copy link
Copy Markdown
Owner

janfri commented Nov 10, 2023

On which Ruby version does it not work?

@prtngn
Copy link
Copy Markdown
Author

prtngn commented Nov 10, 2023

On which Ruby version does it not work?

Ruby is 3.1.1. This problem occurs when the global Frozen Litteral Strings flag is set at the project level.

@prtngn
Copy link
Copy Markdown
Author

prtngn commented Nov 10, 2023

And this PR is not full ) I still need to improve it.

@janfri
Copy link
Copy Markdown
Owner

janfri commented Dec 9, 2023

How about to add a line # frozen_string_literal: false at the top of mini_exiftool.rb? Then it should work when frozen_string_literal is globally set to true in your application.

I'm afraid that your optimizations could be counter productive, since you introduze arrays to avoid manipulation of Strings. It seems that setting frozen_string_literal to true is not so effective how it seems at the first think. See mame's reply: https://bugs.ruby-lang.org/issues/11473#note-59.

@prtngn
Copy link
Copy Markdown
Author

prtngn commented Dec 22, 2023

Yes, # frozen_string_literal: false one of the solutions to the problem

@janfri janfri merged commit a7d0010 into janfri:master Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants