Skip to content
Myr

perf: use saved reference to http.STATUS_CODES

Before adoption: this commit came in with the history the project adopted, so no landing records it.

closes #2602

authored by Thomas Cort · committed by Douglas Christopher Wilson · parent 9073bb4 · Browse files · 2 files+3 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−2 removed

  • other:+3 added−2 removed

2 files+3 added−2 removed

modified:lib/response.js+2 added-2 removed
117 unmodified lines
118 }119120 deprecate('res.send(status): Use res.sendStatus(status) instead');121 this.statusCode = chunk;122 chunk = http.STATUS_CODES[chunk];122 chunk = statusCodes[chunk];123 }124125 switch (typeof chunk) {126 // string defaulting to html
196 unmodified lines
323 * @api public324 */325326res.sendStatus = function sendStatus(statusCode) {327 var body = http.STATUS_CODES[statusCode] || String(statusCode);327 var body = statusCodes[statusCode] || String(statusCode);328329 this.statusCode = statusCode;330 this.type('txt');331
699 unmodified lines
modified:History.md+1 added
59 unmodified lines
60 * deps: type-is@~1.6.361 - deps: mime-types@~2.1.162 - perf: reduce try block size63 - perf: remove bitwise operations64 * perf: use saved reference to `http.STATUS_CODES`65664.12.4 / 2015-05-1767===================68
2880 unmodified lines