Tim Perkins created AVRO-3112:
---------------------------------
Summary: Freeze string literals for Ruby
Key: AVRO-3112
URL: https://issues.apache.org/jira/browse/AVRO-3112
Project: Apache Avro
Issue Type: Task
Components: ruby
Affects Versions: 1.10.2
Reporter: Tim Perkins
Assignee: Tim Perkins
Since Ruby 2.3 there has been an option to freeze all string literals. This
improves both performance by eliminating unnecessary allocations for duplicate
strings and reliability by preventing mutation of values.
A comment can be added to the top of each Ruby file to freeze all string
literals:
{code:java}
# frozen_string_literal: true{code}
The RuboCop linting tool can be used to used to ensure that this is present for
all files. Additional checks can be used to identity and remove existing calls
to `.freeze` that are redundant once this comment is added.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)