Skip to content
Snippets Groups Projects
Commit c111d919 authored by Laurent's avatar Laurent
Browse files

perf improvements on translate

parent 4bea4e87
Branches
Tags
3 merge requests!2080Sandbox detach zf from storm,!2061Master,!1965Performance improvements
......@@ -21,19 +21,12 @@
class ZendAfi_Translate extends Zend_Translate {
public function _() {
$args = func_get_args();
$num = func_num_args();
if (!$num)
if (!$num = func_num_args())
return '';
$args[0] = parent::_(Class_TextReplacements::replace($args[0]));
if($num <= 1) {
return $args[0];
}
return call_user_func_array('sprintf', $args);
return $num <= 1
? parent::_(Class_TextReplacements::replace(func_get_args()[0]))
: call_user_func_array('sprintf', func_get_args());
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment