提交 3ad26c8e 编写于 作者: A Aaron Patterson

avoid object creation via useless duping and freezing

上级 26e53a16
......@@ -63,7 +63,7 @@ module ClassMethods
# the default view path. You may also provide a custom view path
# (see ActionView::PathSet for more information)
def append_view_path(path)
self.view_paths = view_paths + Array(path)
self._view_paths = view_paths + Array(path)
end
# Prepend a path to the list of view paths for this controller.
......@@ -73,7 +73,7 @@ def append_view_path(path)
# the default view path. You may also provide a custom view path
# (see ActionView::PathSet for more information)
def prepend_view_path(path)
self.view_paths = Array(path) + view_paths
self._view_paths = ActionView::PathSet.new(Array(path) + view_paths)
end
# A list of all of the default view paths for this controller.
......@@ -88,7 +88,6 @@ def view_paths
# otherwise, process the parameter into a PathSet.
def view_paths=(paths)
self._view_paths = ActionView::Base.process_view_paths(paths)
self._view_paths.freeze
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册