Skip to content

Commit 54c27ab

Browse files
committed
perf: improve slash collapsing
1 parent 6159b4b commit 54c27ab

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

HISTORY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ unreleased
44
55
66
- perf: improve `If-Match` token parsing
7+
* perf: improve slash collapsing
78

89
1.12.5 / 2017-09-21
910
===================

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function serveStatic (root, options) {
132132
*/
133133
function collapseLeadingSlashes (str) {
134134
for (var i = 0; i < str.length; i++) {
135-
if (str[i] !== '/') {
135+
if (str.charCodeAt(i) !== 0x2f /* / */) {
136136
break
137137
}
138138
}

0 commit comments

Comments
 (0)