Skip to content

Commit 1ecc702

Browse files
committed
Remove nextTicks since they were only needed by node 0.10
See discussion in #740
1 parent 198a61d commit 1ecc702

File tree

3 files changed

+24
-30
lines changed

3 files changed

+24
-30
lines changed

lib/jpegstream.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,13 @@ JPEGStream.prototype._read = function _read() {
6363
var bufsize = this.options.bufsize;
6464
var quality = this.options.quality;
6565
var progressive = this.options.progressive;
66-
process.nextTick(function(){
67-
self.canvas[method](bufsize, quality, progressive, function(err, chunk){
68-
if (err) {
69-
self.emit('error', err);
70-
} else if (chunk) {
71-
self.push(chunk);
72-
} else {
73-
self.push(null);
74-
}
75-
});
66+
self.canvas[method](bufsize, quality, progressive, function(err, chunk){
67+
if (err) {
68+
self.emit('error', err);
69+
} else if (chunk) {
70+
self.push(chunk);
71+
} else {
72+
self.push(null);
73+
}
7674
});
7775
};

lib/pdfstream.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,13 @@ PDFStream.prototype._read = function _read() {
5656
// call canvas.streamPDFSync once and let it emit data at will.
5757
this._read = noop;
5858
var self = this;
59-
process.nextTick(function(){
60-
self.canvas[self.method](function(err, chunk, len){
61-
if (err) {
62-
self.emit('error', err);
63-
} else if (len) {
64-
self.push(chunk);
65-
} else {
66-
self.push(null);
67-
}
68-
});
59+
self.canvas[self.method](function(err, chunk, len){
60+
if (err) {
61+
self.emit('error', err);
62+
} else if (len) {
63+
self.push(chunk);
64+
} else {
65+
self.push(null);
66+
}
6967
});
7068
};

lib/pngstream.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,13 @@ PNGStream.prototype._read = function _read() {
7575
// call canvas.streamPNGSync once and let it emit data at will.
7676
this._read = noop;
7777
var self = this;
78-
process.nextTick(function(){
79-
self.canvas[self.method](function(err, chunk, len){
80-
if (err) {
81-
self.emit('error', err);
82-
} else if (len) {
83-
self.push(chunk);
84-
} else {
85-
self.push(null);
86-
}
87-
});
78+
self.canvas[self.method](function(err, chunk, len){
79+
if (err) {
80+
self.emit('error', err);
81+
} else if (len) {
82+
self.push(chunk);
83+
} else {
84+
self.push(null);
85+
}
8886
});
8987
};

0 commit comments

Comments
 (0)