Skip to content

Commit 38896d6

Browse files
committed
run format.sh
1 parent db37d3a commit 38896d6

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

trantor/unittests/DateUnittest.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ TEST(Date, DatabaseStringTest)
110110
dbString = "1970-01-01";
111111
dbDateGMT = trantor::Date::fromDbString(dbString);
112112
auto epoch = dbDateGMT.microSecondsSinceEpoch();
113-
EXPECT_EQ(epoch,0);
113+
EXPECT_EQ(epoch, 0);
114114
}
115115
int main(int argc, char **argv)
116116
{

trantor/utils/Date.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ Date Date::fromDbStringLocal(const std::string &datetime)
285285
second = {0}, microSecond = {0};
286286
std::vector<std::string> &&v = splitString(datetime, " ");
287287

288-
if(v.size()==0){
288+
if (v.size() == 0)
289+
{
289290
throw std::invalid_argument("Invalid date string: " + datetime);
290291
}
291292
const std::vector<std::string> date = splitString(v[0], "-");
@@ -312,7 +313,8 @@ Date Date::fromDbStringLocal(const std::string &datetime)
312313
if (v.size() == 2)
313314
{
314315
// Format YYYY-MM-DD HH:MM:SS[.UUUUUU] is given
315-
try{
316+
try
317+
{
316318
year = std::stol(date[0]);
317319
month = std::stol(date[1]);
318320
day = std::stol(date[2]);
@@ -336,12 +338,14 @@ Date Date::fromDbStringLocal(const std::string &datetime)
336338
microSecond = std::stol(seconds[1]);
337339
}
338340
}
339-
}catch(...){
341+
}
342+
catch (...)
343+
{
340344
throw std::invalid_argument("Invalid date string: " + datetime);
341345
}
342346
return Date(year, month, day, hour, minute, second, microSecond);
343347
}
344-
348+
345349
throw std::invalid_argument("Invalid date string: " + datetime);
346350
}
347351

0 commit comments

Comments
 (0)