Move initialization in loop

This commit is contained in:
2020-06-02 12:46:54 +02:00
parent e9cafd7845
commit fc93b90164
+5 -4
View File
@@ -72,9 +72,7 @@ int main (int argc, char *argv[])
uint16_t data_empty [] = { 0, 0, 0, 0};
rapidjson::Document header(rapidjson::kObjectType);
auto& header_alloc = header.GetAllocator();
string text_header;
// TODO: Remove stats trash.
int stats_counter = 0;
@@ -84,6 +82,10 @@ int main (int argc, char *argv[])
while (true) {
rapidjson::Document header(rapidjson::kObjectType);
auto& header_alloc = header.GetAllocator();
string text_header;
auto start_time = chrono::steady_clock::now();
auto slot_id = queue.read();
@@ -176,7 +178,6 @@ int main (int argc, char *argv[])
shape[1] = 2;
}
{
rapidjson::StringBuffer buffer;
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);