Memoize Sitemap::Page#destination_path
This commit is contained in:
parent
fdbd301a32
commit
d483d8bc54
|
@ -192,8 +192,9 @@ module Middleman::Sitemap
|
||||||
# This path can be affected by proxy callbacks.
|
# This path can be affected by proxy callbacks.
|
||||||
# @return [String]
|
# @return [String]
|
||||||
def destination_path
|
def destination_path
|
||||||
# TODO: memoize this value
|
# memoizing this means that reroute callbacks should be in place before the sitemap
|
||||||
store.reroute_callbacks.inject(self.path) do |destination, callback|
|
# gets built
|
||||||
|
@destination_path ||= store.reroute_callbacks.inject(self.path) do |destination, callback|
|
||||||
callback.call(destination, self)
|
callback.call(destination, self)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue