Skip to content

Commit bf39584

Browse files
perf(profiling): one less to_slice call (#15099)
## Description As title says – currently we make two Rust calls to do the same thing, we don't need to.
1 parent adc0d6f commit bf39584

File tree

1 file changed

+3
-2
lines changed
  • ddtrace/internal/datadog/profiling/dd_wrapper/src

1 file changed

+3
-2
lines changed

ddtrace/internal/datadog/profiling/dd_wrapper/src/sample.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,12 @@ Datadog::Sample::push_label(const ExportLabelKey key, int64_t val)
119119
return true;
120120
}
121121

122+
auto empty_string = to_slice("");
122123
auto& label = labels.emplace_back();
123124
label.key = to_slice(key_sv);
124-
label.str = to_slice("");
125+
label.str = empty_string;
125126
label.num = val;
126-
label.num_unit = to_slice("");
127+
label.num_unit = empty_string;
127128
return true;
128129
}
129130

0 commit comments

Comments
 (0)