From: Fabien Potencier Date: Sun, 27 Nov 2011 15:46:10 +0000 (+0100) Subject: merged branch arnaud-lb/twig-escape-filter-opt (PR #537) X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=0a0febc32bbb7739df790211dcbe806de8d505a8;p=web%2Fkonrad%2Ftwig.git merged branch arnaud-lb/twig-escape-filter-opt (PR #537) Commits ------- 7b8d476 optimized twig_escape_filter Discussion ---------- Optimized twig_escape_filter This optimizes the part of twig_escape_filter that checks if the charset is supported by htmlspecialchars. This uses a static variable to avoid initializing the charsets array each time the function is called; and does a hash lookup instead of array search (saves a function call too). The optimized version takes 66% less time that the original version on html escaping :) (no difference on js escaping). --- 0a0febc32bbb7739df790211dcbe806de8d505a8