summaryrefslogtreecommitdiffstats
path: root/RecurringType.php
diff options
context:
space:
mode:
authorsten <stenmarsh938@gmail.com>2016-03-14 12:19:33 +0300
committersten <stenmarsh938@gmail.com>2016-03-14 12:19:33 +0300
commit8d35e30f0be18ac922fc2fbe4116dbbcb11329b7 (patch)
tree5285340b053e753b1e1dc4aa97d85e65022eaefd /RecurringType.php
parent4d5f7b1f1686642b376e9b9b8a28dae70a8831d6 (diff)
downloadscheduler-helper-php-8d35e30f0be18ac922fc2fbe4116dbbcb11329b7.zip
scheduler-helper-php-8d35e30f0be18ac922fc2fbe4116dbbcb11329b7.tar.gz
scheduler-helper-php-8d35e30f0be18ac922fc2fbe4116dbbcb11329b7.tar.bz2
Move out array length calculation from "for" loop.
Diffstat (limited to 'RecurringType.php')
-rw-r--r--RecurringType.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/RecurringType.php b/RecurringType.php
index 9ad8ca5..b72810a 100644
--- a/RecurringType.php
+++ b/RecurringType.php
@@ -311,7 +311,8 @@ class RecurringType {
//If recurring type has list of days, then get those days.
$recurringWeekDays = $this->getWeekDaysListValue();
if($recurringWeekDays) {
- for($i = 0; $i < count($recurringWeekDays); $i++) {
+ $daysCount = count($recurringWeekDays);
+ for($i = 0; $i < $daysCount; $i++) {
$dayStep = $this->_getRecurringDayStep($dateStamp, $recurringWeekDays[$i]);
array_push($recurringDays, SchedulerHelperDate::addDays($dateStamp, $dayStep));
}