Comparing version 1.3.1 to 1.3.2
@@ -49,3 +49,3 @@ // Generated by CoffeeScript 1.7.1 | ||
this.columnsByName = {}; | ||
this.rowsData = new WritableTrackingBuffer(100); | ||
this.rowsData = new WritableTrackingBuffer(1024, 'ucs2', true); | ||
} | ||
@@ -52,0 +52,0 @@ |
@@ -21,7 +21,9 @@ // Generated by CoffeeScript 1.7.1 | ||
WritableTrackingBuffer = (function() { | ||
function WritableTrackingBuffer(sizeIncrement, encoding) { | ||
this.sizeIncrement = sizeIncrement; | ||
function WritableTrackingBuffer(initialSize, encoding, doubleSizeGrowth) { | ||
this.initialSize = initialSize; | ||
this.encoding = encoding; | ||
this.doubleSizeGrowth = doubleSizeGrowth; | ||
this.doubleSizeGrowth || (this.doubleSizeGrowth = false); | ||
this.encoding || (this.encoding = 'ucs2'); | ||
this.buffer = new Buffer(this.sizeIncrement); | ||
this.buffer = new Buffer(this.initialSize); | ||
this.position = 0; | ||
@@ -43,4 +45,13 @@ this.__defineGetter__("data", function() { | ||
WritableTrackingBuffer.prototype.makeRoomFor = function(requiredLength) { | ||
var size; | ||
if (this.buffer.length - this.position < requiredLength) { | ||
return this.newBuffer(requiredLength); | ||
if (this.doubleSizeGrowth) { | ||
size = this.buffer.length * 2; | ||
while (size < requiredLength) { | ||
size *= 2; | ||
} | ||
return this.newBuffer(size); | ||
} else { | ||
return this.newBuffer(requiredLength); | ||
} | ||
} | ||
@@ -51,3 +62,3 @@ }; | ||
var buffer; | ||
size || (size = this.sizeIncrement); | ||
size || (size = this.initialSize); | ||
buffer = this.buffer.slice(0, this.position); | ||
@@ -54,0 +65,0 @@ if (this.compositeBuffer) { |
@@ -29,3 +29,3 @@ { | ||
], | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"main": "./lib/tedious.js", | ||
@@ -32,0 +32,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
187135
46
5468