Merge pull request #147 from koajs/delegate-next-bench
benchmark: use generator delegation
This commit is contained in:
commit
b944b89df7
|
@ -10,14 +10,14 @@ console.log(' %s middleware', n);
|
||||||
|
|
||||||
while (n--) {
|
while (n--) {
|
||||||
app.use(function *(next){
|
app.use(function *(next){
|
||||||
yield next;
|
yield *next;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var body = new Buffer('Hello World');
|
var body = new Buffer('Hello World');
|
||||||
|
|
||||||
app.use(function *(next){
|
app.use(function *(next){
|
||||||
yield next;
|
yield *next;
|
||||||
this.body = body;
|
this.body = body;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue