Heartbeat: Don't use a variable of the same name as the function it is in.

fixes #25073.

Built from https://develop.svn.wordpress.org/trunk@26626


git-svn-id: http://core.svn.wordpress.org/trunk@26516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-12-04 19:24:09 +00:00
parent bd17d08545
commit 84c8a669d9
1 changed files with 11 additions and 10 deletions

View File

@ -606,47 +606,48 @@
* @return int Current interval in seconds
*/
function interval( speed, ticks ) {
var interval, oldInerval = settings.tempInterval ? settings.tempInterval : settings.mainInterval;
var newInterval,
oldInterval = settings.tempInterval ? settings.tempInterval : settings.mainInterval;
if ( speed ) {
switch ( speed ) {
case 'fast':
case 5:
interval = 5000;
newInterval = 5000;
break;
case 15:
interval = 15000;
newInterval = 15000;
break;
case 30:
interval = 30000;
newInterval = 30000;
break;
case 60:
interval = 60000;
newInterval = 60000;
break;
case 'long-polling':
// Allow long polling, (experimental)
settings.mainInterval = 0;
return 0;
default:
interval = settings.originalInterval;
newInterval = settings.originalInterval;
}
if ( 5000 === interval ) {
if ( 5000 === newInterval ) {
ticks = parseInt( ticks, 10 ) || 30;
ticks = ticks < 1 || ticks > 30 ? 30 : ticks;
settings.countdown = ticks;
settings.tempInterval = interval;
settings.tempInterval = newInterval;
} else {
settings.countdown = 0;
settings.tempInterval = 0;
settings.mainInterval = interval;
settings.mainInterval = newInterval;
}
// Change the next connection time if new interval has been set.
// Will connect immediately if the time since the last connection
// is greater than the new interval.
if ( interval !== oldInerval ) {
if ( newInterval !== oldInterval ) {
scheduleNextTick();
}
}