Skip to content

Commit e546fa7

Browse files
committed
Improving the connection flow
1 parent 86ee66f commit e546fa7

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

source/databaseConnection.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@
1313
#include <boost/decimal.hpp>
1414

1515
static std::chrono::system_clock::time_point fastParseTimestamp(const char* ts) {
16-
int year = 0, month = 0, day = 0, hour = 0, min = 0, sec = 0, usec = 0;
16+
int year = 0;
17+
int month = 0;
18+
int day = 0;
19+
int hour = 0;
20+
int min = 0;
21+
int sec = 0;
22+
int usec = 0;
1723
const int parsedFields =
1824
std::sscanf(ts, "%4d-%2d-%2d %2d:%2d:%2d.%d", &year, &month, &day, &hour, &min, &sec, &usec);
1925
if (parsedFields != 6 && parsedFields != 7) {
@@ -59,7 +65,8 @@ std::vector<PriceData> DatabaseConnection::streamQuery(const std::string& query)
5965

6066
for (std::size_t i = 0; i < result.size(); ++i) {
6167
const auto& row = result[static_cast<pqxx::result::size_type>(i)];
62-
boost::decimal::decimal64_t ask, bid;
68+
boost::decimal::decimal64_t ask;
69+
boost::decimal::decimal64_t bid;
6370
auto symbol = row[0].view();
6471
auto sv1 = row[1].view();
6572
auto sv2 = row[2].view();

0 commit comments

Comments
 (0)