Skip to content

Commit

Permalink
Merge pull request #10 from smart--petea/use_refactor
Browse files Browse the repository at this point in the history
removed redundant variables
  • Loading branch information
NathanGRomano committed Oct 28, 2014
2 parents 28a6562 + 65428ee commit 9f39093
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,12 @@ Router.prototype.use = function () {
debug('use called %s', args);
var name = typeof args[0] === 'string' || util.isRegExp(args[0]) ? args.shift() : '*';
if (!args.length) throw new Error('we have the name, but need a handler');
var self = this;
var fns = this.fns(name);
var i, arg, type;
for (i=0; i<args.length; i++) {
arg = args[i];
if (util.isArray(arg)) return self.use.apply(self, arg);
type = typeof arg;
if ('function' !== type) return;
fns[fns.length] = [self.index(), arg];
for (var i=0; i<args.length; i++) {
var arg = args[i];
if (util.isArray(arg)) return this.use.apply(this, arg);
if ('function' !== typeof arg) return;
fns.push([this.index(), arg]);
}
return this;
};
Expand Down

0 comments on commit 9f39093

Please sign in to comment.