Permalink
Browse files

perf: remove unnecessary bitwise operator

  • Loading branch information...
1 parent 2038568 commit f4a5575c210847fee43ab54f9cf8b9a8112c790f @dougwilson dougwilson committed Jun 8, 2015
Showing with 4 additions and 2 deletions.
  1. +1 −0 HISTORY.md
  2. +3 −2 index.js
View
@@ -6,6 +6,7 @@ unreleased
* perf: avoid argument reassignment & argument slice
* perf: avoid negotiator recursive construction
* perf: enable strict mode
+ * perf: remove unnecessary bitwise operator
1.2.7 / 2015-05-10
==================
View
@@ -213,8 +213,9 @@ Accepts.prototype.languages = function (languages_) {
*/
function extToMime(type) {
- if (~type.indexOf('/')) return type;
- return mime.lookup(type);
+ return type.indexOf('/') === -1
+ ? mime.lookup(type)
+ : type
}
/**

0 comments on commit f4a5575

Please sign in to comment.