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) {
6161
6262String Point::toLineProtocol () const {
6363 String line = _measurement;
64+ line.reserve (1 + _tags.length () + 1 + _fields.length () + 1 + _timestamp.length ());
6465 if (hasTags ()) {
65- line += " ," + _tags;
66+ line += " ," ;
67+ line += _tags;
6668 }
6769 if (hasFields ()) {
68- line += " " + _fields;
70+ line += " " ;
71+ line += _fields;
6972 }
7073 if (hasTime ()) {
71- line += " " + _timestamp;
74+ line += " " ;
75+ line += _timestamp;
7276 }
7377 return line;
7478}
@@ -105,10 +109,10 @@ void Point::setTime(String timestamp) {
105109}
106110
107111void Point::clearFields () {
108- _fields = " " ;
109- _timestamp = " " ;
112+ _fields = ( char *) nullptr ;
113+ _timestamp = ( char *) nullptr ;
110114}
111115
112116void Point:: clearTags() {
113- _tags = " " ;
117+ _tags = ( char *) nullptr ;
114118}
You can’t perform that action at this time.
0 commit comments