Skip to content

Commit

Permalink
perf: remove property delete from media type parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Sep 29, 2015
1 parent bc9ee0f commit 274206a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ unreleased
* perf: delay type concatenation until needed
* perf: hoist regular expressions
* perf: remove a closure from media type parsing
* perf: remove property delete from media type parsing

0.5.3 / 2015-05-10
==================
Expand Down
10 changes: 5 additions & 5 deletions lib/mediaType.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ function parseMediaType(str, i) {
? val.substr(1, val.length - 2)
: val;

if (key === 'q') {
q = parseFloat(value);
continue;
}

// store parameter
params[key] = value
}

if (params.q != null) {
q = parseFloat(params.q);
delete params.q;
}
}

return {
Expand Down

0 comments on commit 274206a

Please sign in to comment.