diff --git a/lib/jekyll-seo-tag/drop.rb b/lib/jekyll-seo-tag/drop.rb index 3ee277d0..157babd4 100644 --- a/lib/jekyll-seo-tag/drop.rb +++ b/lib/jekyll-seo-tag/drop.rb @@ -11,8 +11,11 @@ class Drop < Jekyll::Drops::Drop ].freeze HOMEPAGE_OR_ABOUT_REGEX = %r!^/(about/)?(index.html?)?$!.freeze + EMPTY_READ_ONLY_HASH = {}.freeze + private_constant :EMPTY_READ_ONLY_HASH + def initialize(text, context) - @obj = {} + @obj = EMPTY_READ_ONLY_HASH @mutations = {} @text = text @context = context @@ -236,7 +239,7 @@ def sub_hash(hash, key) if hash[key].is_a?(Hash) hash[key] else - {} + EMPTY_READ_ONLY_HASH end end end