Skip to content

Commit 1b99093

Browse files
jscissrjasnell
authored andcommitted
timers: remove unused repeat param in timer_wrap
The `repeat` param in `start(timeout, repeat)` was 0 in all callsites. PR-URL: #7994 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Brian White <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent dabac8a commit 1b99093

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

lib/timers.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ function insert(item, unrefed) {
135135
list._timer._list = list;
136136

137137
if (unrefed === true) list._timer.unref();
138-
list._timer.start(msecs, 0);
138+
list._timer.start(msecs);
139139

140140
lists[msecs] = list;
141141
list._timer[kOnTimeout] = listOnTimeout;
@@ -173,7 +173,7 @@ function listOnTimeout() {
173173
if (timeRemaining < 0) {
174174
timeRemaining = 0;
175175
}
176-
this.start(timeRemaining, 0);
176+
this.start(timeRemaining);
177177
debug('%d list wait because diff is %d', msecs, diff);
178178
return;
179179
}
@@ -430,7 +430,7 @@ exports.setInterval = function(callback, repeat) {
430430

431431
// If timer is unref'd (or was - it's permanently removed from the list.)
432432
if (this._handle) {
433-
this._handle.start(repeat, 0);
433+
this._handle.start(repeat);
434434
} else {
435435
timer._idleTimeout = repeat;
436436
active(timer);
@@ -485,7 +485,7 @@ Timeout.prototype.unref = function() {
485485
this._handle = handle || new TimerWrap();
486486
this._handle.owner = this;
487487
this._handle[kOnTimeout] = unrefdHandle;
488-
this._handle.start(delay, 0);
488+
this._handle.start(delay);
489489
this._handle.domain = this.domain;
490490
this._handle.unref();
491491
}

src/timer_wrap.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ class TimerWrap : public HandleWrap {
7474
CHECK(HandleWrap::IsAlive(wrap));
7575

7676
int64_t timeout = args[0]->IntegerValue();
77-
int64_t repeat = args[1]->IntegerValue();
78-
int err = uv_timer_start(&wrap->handle_, OnTimeout, timeout, repeat);
77+
int err = uv_timer_start(&wrap->handle_, OnTimeout, timeout, 0);
7978
args.GetReturnValue().Set(err);
8079
}
8180

test/pummel/test-timer-wrap.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var kOnTimeout = Timer.kOnTimeout;
66

77
var t = new Timer();
88

9-
t.start(1000, 0);
9+
t.start(1000);
1010

1111
t[kOnTimeout] = common.mustCall(function() {
1212
console.log('timeout');

test/timers/test-timers-reliability.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ monoTimer[Timer.kOnTimeout] = function() {
4242
assert(intervalFired);
4343
};
4444

45-
monoTimer.start(300, 0);
45+
monoTimer.start(300);
4646

4747
setTimeout(function() {
4848
timerFired = true;

0 commit comments

Comments
 (0)