Skip to content

Commit 3350b86

Browse files
author
Jake Boxer
committed
Simplify view registry memoization
1 parent 29d5931 commit 3350b86

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

lib/hyperloop/application.rb

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,8 @@ def production?
9696
#
9797
# Returns a Hyperloop::View::Registry
9898
def view_registry
99-
return @view_registry if @view_registry
100-
101-
registry = View::Registry.new(@root)
102-
103-
# Memoize if we're in production so we don't reload views on every
104-
# request.
105-
@view_registry = registry if production?
106-
107-
registry
99+
@view_registry = nil unless production?
100+
@view_registry ||= View::Registry.new(@root)
108101
end
109102
end
110103
end

0 commit comments

Comments
 (0)