Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4535149

Browse filesBrowse files
jscissrcjihrig
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 <info@bnoordhuis.nl> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 3825508 commit 4535149
Copy full SHA for 4535149

File tree

Expand file treeCollapse file tree

4 files changed

+7
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+7
-8
lines changed
Open diff view settings
Collapse file

‎lib/timers.js‎

Copy file name to clipboardExpand all lines: lib/timers.js
+4-4Lines changed: 4 additions & 4 deletions
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
}
Collapse file

‎src/timer_wrap.cc‎

Copy file name to clipboardExpand all lines: src/timer_wrap.cc
+1-2Lines changed: 1 addition & 2 deletions
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

Collapse file

‎test/pummel/test-timer-wrap.js‎

Copy file name to clipboardExpand all lines: test/pummel/test-timer-wrap.js
+1-1Lines changed: 1 addition & 1 deletion
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');
Collapse file

‎test/timers/test-timers-reliability.js‎

Copy file name to clipboardExpand all lines: test/timers/test-timers-reliability.js
+1-1Lines changed: 1 addition & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.