From 7127401aa241939fa7f14c0604aa187546d3b7ef Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Thu, 30 May 2013 21:16:07 -0700 Subject: [PATCH] Micro-optimize some regexes --- middleman-core/lib/middleman-core/sitemap.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/middleman-core/lib/middleman-core/sitemap.rb b/middleman-core/lib/middleman-core/sitemap.rb index 958d6427..88d2bbb9 100644 --- a/middleman-core/lib/middleman-core/sitemap.rb +++ b/middleman-core/lib/middleman-core/sitemap.rb @@ -29,11 +29,11 @@ module Middleman # Files starting with an dot, but not .htaccess :source_dotfiles => proc { |file| - file =~ %r{/\.} && file !~ %r{/\.(htaccess|htpasswd)} + file =~ %r{/\.} && file !~ %r{/\.ht(access|passwd)} }, # Files starting with an underscore, but not a double-underscore - :partials => proc { |file| file =~ %r{/_} && file !~ %r{/__} }, + :partials => proc { |file| file =~ %r{/_[^_]} }, :layout => proc { |file, app| file.start_with?(File.join(app.config[:source], 'layout.')) || file.start_with?(File.join(app.config[:source], 'layouts/'))