Skip to content

Commit

Permalink
Removed redundant string length call.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rarst committed Jan 30, 2018
1 parent 76dc225 commit e819ad0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Type_Template_Hierarchy.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ public function template_hierarchy( $templates ) {
$twig_templates = [];

foreach ( $templates as $php_template ) {

if ( '.php' === substr( $php_template, \strlen( $php_template ) - 4 ) ) {

if ( '.php' === substr( $php_template, - 4 ) ) {
$twig_templates[] = substr( $php_template, 0, - 4 ) . '.twig';
}
}
Expand Down

0 comments on commit e819ad0

Please sign in to comment.