Skip to content
Closed
Prev Previous commit
Next Next commit
fixup! fixup! buffer: refactor to remove some duplicated code in from…
…Object.
  • Loading branch information
entertainyou committed Feb 1, 2016
commit 980f20800baec9033385e1c89a8f332146eb4000
1 change: 0 additions & 1 deletion lib/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ function fromObject(obj) {
throw new TypeError('Must start with number, buffer, array or string');
}


if (obj instanceof ArrayBuffer) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do this check first, we can skip the isArray check and let the if block below this, take care of the creation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated, @thefourtheye .

return binding.createFromArrayBuffer(obj);
}
Expand Down