Skip to content

Commit 2e50767

Browse files
author
Vadim Averin
committed
Remove unnecessary string allocation
1 parent 65d7959 commit 2e50767

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

ydb/library/yql/udfs/common/ip_base/lib/ip_base_udf.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,7 @@ namespace {
231231
}
232232

233233
SIMPLE_STRICT_UDF(TSubnetFromString, TOptionalString(TAutoMapString)) {
234-
TStringRef strRef = args[0].AsStringRef();
235-
TString str(strRef.Data(), strRef.Data() + strRef.Size());
236-
TIpAddressRange range = TIpAddressRange::FromCompactString(str);
234+
TIpAddressRange range = TIpAddressRange::FromCompactString(args[0].AsStringRef());
237235
auto res = SerializeSubnet(range);
238236
return res ? valueBuilder->NewString(res) : TUnboxedValue(TUnboxedValuePod());
239237
}

0 commit comments

Comments
 (0)