node-bin-packing icon indicating copy to clipboard operation
node-bin-packing copied to clipboard

Bug in sort function of usage example

Open urraka opened this issue 12 years ago • 0 comments

Not a big problem but it can be misleading. The sort function should return a value less than 0 when a goes before b, 0 when equal, and greater than 0 when a goes after b.

A correction could be something like this:

blocks.sort(function(a,b) { return (b.h - a.h); });

urraka avatar Aug 09 '13 20:08 urraka