Commit 4c05d6a0 authored by Rich Trott's avatar Rich Trott Committed by James M Snell
Browse files

buffer: refactor Buffer.prototype.inspect()

Replace toString().match().join() with toString().replace().trim(). This
enables the elimination of a length check becuase replace() will return
empty string if Buffer is empty whereas match() returns null.

PR-URL: https://github.com/nodejs/node/pull/11600


Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarYuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: default avatarLuigi Pinca <luigipinca@gmail.com>
parent 0d4bbf75
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment