Skip to content

Commit

Permalink
no need for string conversion since it's all JS
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthropohedron committed Apr 4, 2015
1 parent 523132e commit cbe8eed
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions lib/matcher.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
/*jslint vars: true, white: true, plusplus: true, todo: true */
"use strict";
var tagMaps = require('./tagmaps');
var chrome = require("chrome");
var Cc = chrome.Cc;
var Ci = chrome.Ci;

var cvtUTF8 = (function(contractId, intf) {
return Cc[contractId].createInstance(Ci[intf]);
}("@mozilla.org/intl/scriptableunicodeconverter",
"nsIScriptableUnicodeConverter"));

function AbstractPattern(apply) {
if (!apply) { return; }
Expand Down Expand Up @@ -84,8 +76,7 @@ function HostPattern(pattern) {
}
HostPattern.prototype = new AbstractPattern({
testURI: function testURI(uri) {
var host = cvtUTF8.ConvertToUnicode(uri.host);
return this.hostRE.test(host);
return this.hostRE.test(uri.host);
},
testRequest: function testRequest(req) {
return this.testURI(req.URI);
Expand All @@ -110,9 +101,7 @@ function PathPattern(pattern) {
}
PathPattern.prototype = new AbstractPattern({
testURI: function testURI(uri) {
var host = cvtUTF8.ConvertToUnicode(uri.host);
var path = cvtUTF8.ConvertToUnicode(uri.path);
return this.hostRE.test(host) && this.pathRE.test(path);
return this.hostRE.test(uri.host) && this.pathRE.test(uri.path);
},
testRequest: function testRequest(req) {
return this.testURI(req.URI);
Expand Down

0 comments on commit cbe8eed

Please sign in to comment.