rename util module to ip2region_util

This commit is contained in:
LeiHua 2023-01-14 10:17:21 +08:00
parent a3c22a05f8
commit edeb926a1e
3 changed files with 3 additions and 3 deletions

View File

@ -13,7 +13,7 @@
-spec search(Ip :: tuple() | list() | binary()) -> Result :: {error, Reason::atom()} | map(). -spec search(Ip :: tuple() | list() | binary()) -> Result :: {error, Reason::atom()} | map().
search(Ip) -> search(Ip) ->
case util:ipv4_to_n(Ip) of case ip2region_util:ipv4_to_n(Ip) of
IntIp when is_integer(IntIp) -> IntIp when is_integer(IntIp) ->
case ets:lookup(?IP2REGION_CACHE, IntIp) of case ets:lookup(?IP2REGION_CACHE, IntIp) of
[{_IntIp, Region}] -> Region; [{_IntIp, Region}] -> Region;

View File

@ -1,4 +1,4 @@
-module(util). -module(ip2region_util).
-export([ipv4_to_n/1]). -export([ipv4_to_n/1]).

View File

@ -135,7 +135,7 @@ load_vector_index_aux(<<SPtr:32/little, EPtr:32/little, VectorIndexBin/binary>>,
search_ip(IoDevice, Ip) -> search_ip(IoDevice, Ip) ->
IntIp = util:ipv4_to_n(Ip), IntIp = ip2region_util:ipv4_to_n(Ip),
case ets:lookup(?IP2REGION_CACHE, IntIp) of case ets:lookup(?IP2REGION_CACHE, IntIp) of
[{_IntIp, RegionInfo}] -> [{_IntIp, RegionInfo}] ->
RegionInfo; RegionInfo;