Reduce array allocations from merging categories (#8453)
Merge pull request 8453
This commit is contained in:
parent
02d25d1cf2
commit
bf18b27e2a
|
@ -453,7 +453,10 @@ module Jekyll
|
||||||
def merge_categories!(other)
|
def merge_categories!(other)
|
||||||
if other.key?("categories") && !other["categories"].nil?
|
if other.key?("categories") && !other["categories"].nil?
|
||||||
other["categories"] = other["categories"].split if other["categories"].is_a?(String)
|
other["categories"] = other["categories"].split if other["categories"].is_a?(String)
|
||||||
other["categories"] = (data["categories"] || []) | other["categories"]
|
|
||||||
|
if data["categories"].is_a?(Array)
|
||||||
|
other["categories"] = data["categories"] | other["categories"]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue