Skip to content

Commit edb8dea

Browse files
author
Enric Sala
committed
Improve the performance of write builder when there is just one item
It is possible to skip the string builder when there is only one item.
1 parent aa5ff7f commit edb8dea

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

influxdb-client/WriteBuilder.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050
if isempty(obj.Items)
5151
warning('this writer is empty');
5252
str = '';
53+
elseif isscalar(obj.Items)
54+
item = obj.Items{1};
55+
str = item.toLine();
5356
else
5457
builder = java.lang.StringBuilder();
5558
for i = 1:length(obj.Items)

0 commit comments

Comments
 (0)