From 289cd023d423b8ccb8c27a317c95d4e9a791fe09 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Fri, 26 Nov 2010 15:44:36 -0500 Subject: [PATCH] Optimize dot notation check Don't try to traverse dot notation unless there's a dot in the variable name. --- Mustache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mustache.php b/Mustache.php index afbc353..4638a2a 100644 --- a/Mustache.php +++ b/Mustache.php @@ -660,7 +660,7 @@ class Mustache { * @return string */ protected function _getVariable($tag_name) { - if ($this->_hasPragma(self::PRAGMA_DOT_NOTATION) && $tag_name != '.') { + if ($tag_name != '.' && strpos($tag_name, '.') !== false && $this->_hasPragma(self::PRAGMA_DOT_NOTATION)) { $chunks = explode('.', $tag_name); $first = array_shift($chunks);