src: only memcmp if length > 0 in Buffer::Compare
authorKarl Skomski <karl@skomski.com>
Fri, 21 Aug 2015 11:31:24 +0000 (13:31 +0200)
committerRod Vagg <rod@vagg.org>
Wed, 2 Sep 2015 11:32:16 +0000 (21:32 +1000)
commit0357c8fc719f0750c2b935eb876760fd01ea4cc9
tree3748e5fb192a9ea5d21777cc8b4b96d2c1376a52
parentc7351db6dc959edc390b332ffdd0f38fa07a3202
src: only memcmp if length > 0 in Buffer::Compare

Both pointer arguments to memcmp are defined as non-null
and compiler optimizes upon that.

PR-URL: https://github.com/nodejs/node/pull/2544
Reviewed-By: trevnorris - Trevor Norris <trev.norris@gmail.com>
Reviewed-By: thefourtheye - Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
src/node_buffer.cc
test/parallel/test-buffer.js