From faa2daed6c2430336267a1bad675abf2585edd84 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sat, 12 May 2018 23:25:21 -0400 Subject: [PATCH] stream: simplify Writable.prototype.cork() This commit removes an unnecessary intermediate variable. PR-URL: https://github.com/nodejs/node/pull/20697 Reviewed-By: Daniel Bevenius Reviewed-By: Luigi Pinca Reviewed-By: Minwoo Jung Reviewed-By: Ruben Bridgewater Reviewed-By: Trivikram Kamat Reviewed-By: James M Snell --- lib/_stream_writable.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index fff47a703fe252..3df14206f17789 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -299,9 +299,7 @@ Writable.prototype.write = function(chunk, encoding, cb) { }; Writable.prototype.cork = function() { - var state = this._writableState; - - state.corked++; + this._writableState.corked++; }; Writable.prototype.uncork = function() {