mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-06 10:25:41 +02:00
Avoid needlessly constructing a temporary string
This commit is contained in:
+2
-2
@@ -102,7 +102,7 @@ static void quote(std::string *buf, const char *s) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
*out = '\0';
|
*out = '\0';
|
||||||
buf->append(std::string(tmp));
|
buf->append(tmp, strlen(tmp));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void aprintf(std::string *buf, const char *format, ...) {
|
static void aprintf(std::string *buf, const char *format, ...) {
|
||||||
@@ -116,7 +116,7 @@ static void aprintf(std::string *buf, const char *format, ...) {
|
|||||||
}
|
}
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
buf->append(std::string(tmp));
|
buf->append(tmp, strlen(tmp));
|
||||||
free(tmp);
|
free(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user