* imc_channel, imc_raw: optimize with pass by reference
* imc_object: asc_time, localtime: make threadsafe * imc_datatype: satisfy 'rule of two' * python: remove all unused imports
This commit is contained in:
@@ -501,16 +501,16 @@ namespace imc
|
||||
second_ = std::stod( get_parameter(buffer,¶meters[7]) );
|
||||
|
||||
time_t rawtime;
|
||||
struct tm* ts;
|
||||
struct tm ts;
|
||||
time(&rawtime);
|
||||
ts = localtime(&rawtime);
|
||||
ts->tm_mday = day_;
|
||||
ts->tm_mon = month_-1;
|
||||
ts->tm_year = year_-1900;
|
||||
ts->tm_hour = hour_;
|
||||
ts->tm_min = minute_;
|
||||
ts->tm_sec = (int)second_;
|
||||
timestamp_ = asctime(ts);
|
||||
localtime_r(&rawtime,&ts);
|
||||
ts.tm_mday = day_;
|
||||
ts.tm_mon = month_-1;
|
||||
ts.tm_year = year_-1900;
|
||||
ts.tm_hour = hour_;
|
||||
ts.tm_min = minute_;
|
||||
ts.tm_sec = (int)second_;
|
||||
asctime_r(&ts,×tamp_[0]);
|
||||
// timestamp_ = std::to_string(year_) + std::string("-") + std::to_string(month_)
|
||||
// + std::string("-") + std::to_string(day_)
|
||||
// + std::string("T") + std::to_string(hour_)
|
||||
|
Reference in New Issue
Block a user