Skip to content

Commit b752aaa

Browse files
committed
perf: remove argument reassignment
1 parent 77aa821 commit b752aaa

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

HISTORY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ unreleased
1717
- perf: enable strict mode
1818
- perf: remove unnecessary array allocations
1919
* perf: enable strict mode
20+
* perf: remove argument reassignment
2021

2122
1.9.3 / 2015-05-14
2223
==================

index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ function serveStatic(root, options) {
4646
// copy options object
4747
var opts = Object.create(options || null)
4848

49-
// resolve root to absolute
50-
root = resolve(root)
51-
5249
// default redirect
5350
var redirect = opts.redirect !== false
5451

@@ -62,7 +59,7 @@ function serveStatic(root, options) {
6259

6360
// setup options for send
6461
opts.maxage = opts.maxage || opts.maxAge || 0
65-
opts.root = root
62+
opts.root = resolve(root)
6663

6764
return function serveStatic(req, res, next) {
6865
if (req.method !== 'GET' && req.method !== 'HEAD') {

0 commit comments

Comments
 (0)