joyent/node — pull request #4811 by trevnorris (2013-02-20 19:00:31+00:00)
Title: buffer: check logic simplification

Checks have been simplified and optimized for most-used cases.

Calling Buffer with another Buffer as the subject will now use the
SlowBuffer Copy method instead of the for loop.

No need to call for value coercion, just place the ternary inline.

benchmarks:
```
test master patch
-------------------------------------------------
Buffer - 1: 2519 ops/ms 3503 ops/ms
new Buffer - 1: 2887 ops/ms 3929 ops/ms
Buffer - 100: 2551 ops/ms 3523 ops/ms
new Buffer - 100: 2860 ops/ms 3706 ops/ms
Buffer - 1000: 1604 ops/ms 1827 ops/ms
new Buffer - 1000: 1727 ops/ms 1906 ops/ms
new Buffer - Buffer: 430 ops/ms 1438 ops/ms
Buffer - [10]: 1874 ops/ms 1730 ops/ms
Buffer - str: 641 ops/ms 820 ops/ms
```