From 1b99093df78b795052c944fc6388a934e84e89ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Sch=C3=A4r?= Date: Sat, 6 Aug 2016 14:29:50 +0200 Subject: [PATCH] timers: remove unused repeat param in timer_wrap The `repeat` param in `start(timeout, repeat)` was 0 in all callsites. PR-URL: https://github.com/nodejs/node/pull/7994 Reviewed-By: Ben Noordhuis Reviewed-By: Brian White Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- lib/timers.js | 8 ++++---- src/timer_wrap.cc | 3 +-- test/pummel/test-timer-wrap.js | 2 +- test/timers/test-timers-reliability.js | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/timers.js b/lib/timers.js index 52667a7d8646b4..f6ecf3e100a81e 100644 --- a/lib/timers.js +++ b/lib/timers.js @@ -135,7 +135,7 @@ function insert(item, unrefed) { list._timer._list = list; if (unrefed === true) list._timer.unref(); - list._timer.start(msecs, 0); + list._timer.start(msecs); lists[msecs] = list; list._timer[kOnTimeout] = listOnTimeout; @@ -173,7 +173,7 @@ function listOnTimeout() { if (timeRemaining < 0) { timeRemaining = 0; } - this.start(timeRemaining, 0); + this.start(timeRemaining); debug('%d list wait because diff is %d', msecs, diff); return; } @@ -430,7 +430,7 @@ exports.setInterval = function(callback, repeat) { // If timer is unref'd (or was - it's permanently removed from the list.) if (this._handle) { - this._handle.start(repeat, 0); + this._handle.start(repeat); } else { timer._idleTimeout = repeat; active(timer); @@ -485,7 +485,7 @@ Timeout.prototype.unref = function() { this._handle = handle || new TimerWrap(); this._handle.owner = this; this._handle[kOnTimeout] = unrefdHandle; - this._handle.start(delay, 0); + this._handle.start(delay); this._handle.domain = this.domain; this._handle.unref(); } diff --git a/src/timer_wrap.cc b/src/timer_wrap.cc index f3267e9448527a..843fde4673b071 100644 --- a/src/timer_wrap.cc +++ b/src/timer_wrap.cc @@ -74,8 +74,7 @@ class TimerWrap : public HandleWrap { CHECK(HandleWrap::IsAlive(wrap)); int64_t timeout = args[0]->IntegerValue(); - int64_t repeat = args[1]->IntegerValue(); - int err = uv_timer_start(&wrap->handle_, OnTimeout, timeout, repeat); + int err = uv_timer_start(&wrap->handle_, OnTimeout, timeout, 0); args.GetReturnValue().Set(err); } diff --git a/test/pummel/test-timer-wrap.js b/test/pummel/test-timer-wrap.js index b71a72f42568e7..659912d1fc28ce 100644 --- a/test/pummel/test-timer-wrap.js +++ b/test/pummel/test-timer-wrap.js @@ -6,7 +6,7 @@ var kOnTimeout = Timer.kOnTimeout; var t = new Timer(); -t.start(1000, 0); +t.start(1000); t[kOnTimeout] = common.mustCall(function() { console.log('timeout'); diff --git a/test/timers/test-timers-reliability.js b/test/timers/test-timers-reliability.js index 6d0676dcd8152c..0626c45826781b 100644 --- a/test/timers/test-timers-reliability.js +++ b/test/timers/test-timers-reliability.js @@ -42,7 +42,7 @@ monoTimer[Timer.kOnTimeout] = function() { assert(intervalFired); }; -monoTimer.start(300, 0); +monoTimer.start(300); setTimeout(function() { timerFired = true;