mirror of
https://github.com/iBug/pac.git
synced 2025-07-13 21:02:16 +08:00
Use Array.prototype.map()
This commit is contained in:
parent
e8e027b84d
commit
651befc638
5
code.js
5
code.js
@ -2,9 +2,8 @@
|
|||||||
// Time: @@TIME@@
|
// Time: @@TIME@@
|
||||||
|
|
||||||
function belongsToSubnet(host, list) {
|
function belongsToSubnet(host, list) {
|
||||||
var ip = host.split(".");
|
var ip = host.split(".").map(Number);
|
||||||
ip = 0x1000000 * Number(ip[0]) + 0x10000 * Number(ip[1]) +
|
ip = 0x1000000 * ip[0] + 0x10000 * ip[1] + 0x100 * ip[2] + ip[3];
|
||||||
0x100 * Number(ip[2]) + Number(ip[3]);
|
|
||||||
|
|
||||||
if (ip < list[0][0])
|
if (ip < list[0][0])
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user