Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Avoid function usage in loops #5833

Merged
merged 1 commit into from
Feb 18, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/Zend/Ldap/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ public static function getDateTimeAttribute(array $data, $attribName, $index = n
{
$values = static::getAttribute($data, $attribName, $index);
if (is_array($values)) {
for ($i = 0; $i < count($values); $i++) {
for ($i = 0, $count = count($values); $i < $count; $i++) {
$newVal = static::valueFromLdapDateTime($values[$i]);
if ($newVal !== null) {
$values[$i] = $newVal;
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Ldap/Filter/MaskFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct($mask, $value)
{
$args = func_get_args();
array_shift($args);
for ($i = 0; $i < count($args); $i++) {
for ($i = 0, $count = count($args); $i < $count; $i++) {
$args[$i] = static::escapeValue($args[$i]);
}
$filter = vsprintf($mask, $args);
Expand Down
6 changes: 3 additions & 3 deletions library/Zend/Mime/Mime.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Mime
"\xEF","\xF0","\xF1","\xF2","\xF3","\xF4","\xF5","\xF6",
"\xF7","\xF8","\xF9","\xFA","\xFB","\xFC","\xFD","\xFE",
"\xFF"
);
);

public static $qpReplaceValues = array(
"=00","=01","=02","=03","=04","=05","=06","=07",
Expand All @@ -79,7 +79,7 @@ class Mime
"=EF","=F0","=F1","=F2","=F3","=F4","=F5","=F6",
"=F7","=F8","=F9","=FA","=FB","=FC","=FD","=FE",
"=FF"
);
);

public static $qpKeysString =
"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF";
Expand Down Expand Up @@ -208,7 +208,7 @@ public static function encodeQuotedPrintableHeader($str, $charset,
}

// assemble the lines together by pre- and appending delimiters, charset, encoding.
for ($i = 0; $i < count($lines); $i++) {
for ($i = 0, $count = count($lines); $i < $count; $i++) {
$lines[$i] = " " . $prefix . $lines[$i] . "?=";
}
$str = trim(implode($lineEnd, $lines));
Expand Down