File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 46
46
end
47
47
48
48
% Build line protocol
49
- function str = build(obj )
49
+ function lines = build(obj )
50
+ lines = ' ' ;
50
51
if isempty(obj .Items )
51
52
warning(' this writer is empty' );
52
- str = ' ' ;
53
53
elseif isscalar(obj .Items )
54
54
item = obj.Items{1 };
55
- str = item .toLine();
55
+ lines = item .toLine(obj . Precision );
56
56
else
57
- builder = java .lang .StringBuilder();
58
57
for i = 1 : length(obj .Items )
59
58
item = obj.Items{i };
60
- builder .append(item .toLine(obj .Precision ));
61
- builder .append(newline );
59
+ line = item .toLine(obj .Precision );
60
+ if ~isempty(line )
61
+ lines = [lines , line , newline ];
62
+ end
63
+ end
64
+ if ~isempty(lines )
65
+ lines = lines(1 : end - 1 );
62
66
end
63
- builder .deleteCharAt(int32(builder .length() - 1 ));
64
- str = char(builder .toString());
65
67
end
66
68
end
67
69
You can’t perform that action at this time.
0 commit comments