diff --git a/CHANGELOG.md b/CHANGELOG.md index be75438d6c..39262bcdfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Haml Changelog +* Performance/memory improvement in `lib/haml/util.rb` that saves a string allocation [#965](https://github.com/haml/haml/pull/965) (thanks [Dillon Welch](https://github.com/oniofchaos)) * Add constant for default options in `lib/haml/helpers/action_view_mods.rb` [#966](https://github.com/haml/haml/pull/966) (thanks [Dillon Welch](https://github.com/oniofchaos)) * Performance/memory usage improvement in `lib/haml/buffer.rb` [#963](https://github.com/haml/haml/pull/963) (thanks [Dillon Welch](https://github.com/oniofchaos)) diff --git a/lib/haml/util.rb b/lib/haml/util.rb index 41ba0de2f0..5bfce0e5c0 100644 --- a/lib/haml/util.rb +++ b/lib/haml/util.rb @@ -212,7 +212,7 @@ def unescape_interpolation(str, escape_html = nil) else scan.scan(/\w+/) end - content = eval('"' + interpolated + '"') + content = eval("\"#{interpolated}\"") content.prepend(char) if char == '@' || char == '$' content = "Haml::Helpers.html_escape((#{content}))" if escape_html