Skip to content

Commit

Permalink
修正判断最后一个节点的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyi7 committed Oct 2, 2024
1 parent dbbcdb6 commit e9d2340
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions gfw.pac
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function ipToBinary(ip) {

function searchRadixTree(bits) {
var currentNode = radixTree;
let isLastNode = false;
var isLastNode = false;
for (var i=0; i<bits.length; i++) {
var char = bits[i];
if (currentNode[char]) {
Expand All @@ -72,7 +72,7 @@ function searchRadixTree(bits) {
break;
}
}
return isLastNode
return isLastNode;
}

function isInDirectDomain(host) {
Expand Down Expand Up @@ -166,7 +166,7 @@ function debug(msg, host, ip) {
var radixTree = new RadixTree();

(function () {
var startTime = new Date().getMilliseconds()
var startTime = new Date().getMilliseconds();
debug('开始生成 Radix Tree', 'PAC文件载入开始', startTime.toString());
for (let i=0; i<cidrs.length; i++) {
var cidr = cidrs[i];
Expand Down
6 changes: 3 additions & 3 deletions pac-template
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function ipToBinary(ip) {

function searchRadixTree(bits) {
var currentNode = radixTree;
let isLastNode = false;
var isLastNode = false;
for (var i=0; i<bits.length; i++) {
var char = bits[i];
if (currentNode[char]) {
Expand All @@ -72,7 +72,7 @@ function searchRadixTree(bits) {
break;
}
}
return isLastNode
return isLastNode;
}

function isInDirectDomain(host) {
Expand Down Expand Up @@ -166,7 +166,7 @@ function debug(msg, host, ip) {
var radixTree = new RadixTree();

(function () {
var startTime = new Date().getMilliseconds()
var startTime = new Date().getMilliseconds();
debug('开始生成 Radix Tree', 'PAC文件载入开始', startTime.toString());
for (let i=0; i<cidrs.length; i++) {
var cidr = cidrs[i];
Expand Down

0 comments on commit e9d2340

Please sign in to comment.