This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var log = console.log | |
| , Kombo = require( '../' ) | |
| , test = function ( mbytes ) { | |
| var mb = Math.max( mbytes, 1 ) | |
| , b = new Buffer( mb * 1024 * 1024 ) | |
| , stime = -1 | |
| , etime= -1 | |
| , i = 0 | |
| ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://github.com/joyent/node/blob/master/lib/buffer.js R#~208 | |
| ... | |
| // Are we slicing? | |
| if (typeof offset === 'number') { | |
| this.length = Math.floor( encoding ); // <-- probably also here | |
| this.parent = subject; | |
| this.offset = offset; | |
| } else { | |
| // Find the length | |
| switch (type = typeof subject) { |