Micro-optimizations around string comparisons

This commit is contained in:
Ben Hollis 2013-02-09 00:20:37 -08:00
parent ed119bed7b
commit 923697b517
11 changed files with 33 additions and 26 deletions

View file

@ -408,7 +408,7 @@ module Middleman
# Find the path by searching or using the cache
request_path = request_path.to_s
cache.fetch(:resolve_template, request_path, options) do
relative_path = request_path.sub(%r{^/}, "")
relative_path = Util.strip_leading_slash(request_path)
on_disk_path = File.expand_path(relative_path, self.source_dir)
# By default, any engine will do