[livejournal] r23078: LJSUP-13883: Journal pages optimizaiton ...
Committer: sbelyaev
LJSUP-13883: Journal pages optimizaiton : stage 1U trunk/cgi-bin/LJ/S2.pm
Modified: trunk/cgi-bin/LJ/S2.pm
===================================================================
--- trunk/cgi-bin/LJ/S2.pm 2012-10-09 12:58:28 UTC (rev 23077)
+++ trunk/cgi-bin/LJ/S2.pm 2012-10-09 13:00:19 UTC (rev 23078)
@@ -2929,6 +2929,9 @@
$hour = $neg ? "-$hour" : "$hour";
$timezone = $hour . $partial_hour;
+ return $u->{'__cached_s2_tz_' . $timezone}
+ if $u->{'__cached_s2_tz_' . $timezone};
+
my $now = DateTime->now( time_zone => $timezone );
$ret->{year} = $now->year;
$ret->{month} = $now->month;
@@ -2941,6 +2944,7 @@
# so first we make DT's be 0-based/Sun-Sat, then shift it up to 1-based.
$ret->{_dayofweek} = ($now->day_of_week % 7) + 1;
+ $u->{'__cached_s2_tz_' . $timezone} = $ret;
return $ret;
}
