Don't use map() to generate masks.

This commit is contained in:
James Coglan
2011-12-19 10:12:26 +00:00
parent 9c1e260784
commit 421f4660e5
+3 -2
View File
@@ -230,8 +230,9 @@ var instance = {
buffer.copy(frame, offset + insert);
if (this._masking) {
mask = new Buffer([1,2,3,4].map(function() { return Math.floor(Math.random() * 256) }));
mask.copy(frame, header);
mask = [Math.floor(Math.random() * 256), Math.floor(Math.random() * 256),
Math.floor(Math.random() * 256), Math.floor(Math.random() * 256)];
new Buffer(mask).copy(frame, header);
Protocol8Parser.mask(frame, mask, offset);
}