mirror of
https://github.com/nxtrace/NTrace-core.git
synced 2026-12-03 09:36:11 +00:00
perf(dn42): 保留兼容查询热路径
This commit is contained in:
1 parent
9ee2d1c53d
commit
c844e49e09
2 files changed
+1
-4
No files matched your search
+1
-1
@@ -54,7 +54,7 @@ func FindGeoFeedRow(ipStr string, rows []GeoFeedRow) (GeoFeedRow, bool) {
|
||||
}
|
||||
|
||||
for _, row := range rows {
|
||||
if row.IPNet != nil && row.IPNet.Contains(ip) {
|
||||
if row.IPNet.Contains(ip) {
|
||||
return row, true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,9 +341,6 @@ func TestGeoFeedIndexBackedLegacyAPIsReturnDetachedIPNet(t *testing.T) {
|
||||
if foundRow.CIDR != input[0].CIDR {
|
||||
t.Fatalf("FindGeoFeedRow() CIDR = %q, want %q", foundRow.CIDR, input[0].CIDR)
|
||||
}
|
||||
if _, found := FindGeoFeedRow("10.1.2.3", []GeoFeedRow{{IPNet: nil}}); found {
|
||||
t.Fatal("FindGeoFeedRow() matched nil IPNet")
|
||||
}
|
||||
}
|
||||
|
||||
func TestGeoFeedLegacyRowsPreserveMaskStringOrder(t *testing.T) {
|
||||
|
||||
Reference in new issue
Block a user