perf(dn42): 保留兼容查询热路径

This commit is contained in:
tsosunchia committed 2026-09-04 21:42:53 +08:00
1 parent 9ee2d1c53d
commit c844e49e09
2 files changed
+1 -4

No files matched your search

+1 -1
View File
@@ -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
}
}
-3
View File
@@ -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) {