Skip to content

Commit

Permalink
Performance improvement of Lotus::Layout.template
Browse files Browse the repository at this point in the history
We want to remove suffix only so we need replace only its first
occurrence. `String#sub` in this case is more suitable here because of
being faster than `String#gsub`.
  • Loading branch information
deepj committed Jan 7, 2016
1 parent 2fe9373 commit c8b6fe0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/lotus/layout.rb
Expand Up @@ -78,7 +78,7 @@ def registry
#
# ApplicationLayout.template # => 'application'
def template
super.gsub(suffix, '')
super.sub(suffix, '')
end

# Template name suffix
Expand Down

0 comments on commit c8b6fe0

Please sign in to comment.