From 132a80dddd9a15862643d8e059df36dedcb2fb74 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 7 Feb 2010 09:37:07 -0800 Subject: [PATCH] Checking the identifier before the attributes makes nanoc faster. --- doc-src/lib/stylesheets.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc-src/lib/stylesheets.rb b/doc-src/lib/stylesheets.rb index 2a2fa704..eb28d75b 100644 --- a/doc-src/lib/stylesheets.rb +++ b/doc-src/lib/stylesheets.rb @@ -33,8 +33,9 @@ def reference_item(options) path = stylesheet_path(stylesheet) if path @items.detect do |i| - i[:stylesheet] == path && - i.identifier =~ /^\/reference/ + i.identifier =~ /^\/reference/ && + i[:stylesheet] == path + end end end @@ -136,7 +137,9 @@ end def example_items @site.cached("examples") do - @items.select{|i| i[:example]} + @items.select do |i| + i.identifier =~ /^\/examples/ && i[:example] + end end end