Don't use "and" and "not" in if statements
@@ -114,27 +114,27 @@ void Logger::start_logging() {
m_values_valid = false;
m_logging_on = true;
m_log_start = Clock::now();
- if((not m_params->output_folder.empty()) and (m_params->log_interval != 0)){
+ if((!m_params->output_folder.empty()) && (m_params->log_interval != 0)){
std::thread(logging, m_params).detach();
}
}
void Logger::stop_logging() {
- if(not m_logging_on) return;
+ if(!m_logging_on) return;
m_logging_on = false;
m_log_end = Clock::now();
std::thread(calculate_benchmark_data, m_params).detach();
- if(not m_params->output_folder.empty()) {
+ if(!m_params->output_folder.empty()) {
m_log_files.emplace_back(m_params->output_folder + "/" + program_name + "_" + get_log_suffix());
std::thread(writeFile, m_log_files.back()).detach();
}
}
void Logger::try_log() {
- if(not is_active()) return;
- if(not m_values_valid) return;
+ if(!is_active()) return;
+ if(!m_values_valid) return;
auto now = Clock::now();
auto elapsedLog = now - m_log_start;
@@ -143,7 +143,7 @@ void Logger::try_log() {
currentLogData.frametime = frametime;
m_log_array.push_back(currentLogData);
- if(m_params->log_duration and (elapsedLog >= std::chrono::seconds(m_params->log_duration))){
+ if(m_params->log_duration && (elapsedLog >= std::chrono::seconds(m_params->log_duration))){
stop_logging();
}
}
