File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -61,14 +61,18 @@ void Point::putField(String name, String value) {
61
61
62
62
String Point::toLineProtocol () const {
63
63
String line = _measurement;
64
+ line.reserve (1 + _tags.length () + 1 + _fields.length () + 1 + _timestamp.length ());
64
65
if (hasTags ()) {
65
- line += " ," + _tags;
66
+ line += " ," ;
67
+ line += _tags;
66
68
}
67
69
if (hasFields ()) {
68
- line += " " + _fields;
70
+ line += " " ;
71
+ line += _fields;
69
72
}
70
73
if (hasTime ()) {
71
- line += " " + _timestamp;
74
+ line += " " ;
75
+ line += _timestamp;
72
76
}
73
77
return line;
74
78
}
@@ -105,10 +109,10 @@ void Point::setTime(String timestamp) {
105
109
}
106
110
107
111
void Point::clearFields () {
108
- _fields = " " ;
109
- _timestamp = " " ;
112
+ _fields = ( char *) nullptr ;
113
+ _timestamp = ( char *) nullptr ;
110
114
}
111
115
112
116
void Point:: clearTags() {
113
- _tags = " " ;
117
+ _tags = ( char *) nullptr ;
114
118
}
You can’t perform that action at this time.
0 commit comments