Skip to content

Commit 0763113

Browse files
hynekkarcejkato2
andauthored
Apply suggestions from code review
Co-authored-by: Tomas Cejka <[email protected]>
1 parent 46aaf86 commit 0763113

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

output/unirec.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ UR_FIELDS (
9595
* \brief Constructor.
9696
*/
9797
UnirecExporter::UnirecExporter() : m_basic_idx(-1), m_ext_cnt(0),
98-
m_ifc_map(nullptr),m_tmplts(nullptr), m_records(nullptr), m_ifc_cnt(0),
99-
m_ext_id_flgs(nullptr),m_eof(false), m_odid(false),m_link_bit_field(0),
100-
m_dir_bit_field(0)
98+
m_ifc_map(nullptr), m_tmplts(nullptr), m_records(nullptr), m_ifc_cnt(0),
99+
m_ext_id_flgs(nullptr), m_eof(false), m_odid(false), m_link_bit_field(0),
100+
m_dir_bit_field(0)
101101
{
102102
}
103103

@@ -363,7 +363,7 @@ int UnirecExporter::export_flow(const Flow &flow)
363363

364364
m_flows_seen++;
365365
uint64_t tmplt_dbits = 0; // templates dirty bits
366-
memset(m_ext_id_flgs, 0, sizeof(int)*m_ext_cnt); // in case one flow has multiple extension of same type
366+
memset(m_ext_id_flgs, 0, sizeof(int) * m_ext_cnt); // in case one flow has multiple extension of same type
367367
int ext_processed_cnd = 0;
368368
while (ext != nullptr) {
369369
if (ext->m_ext_id >= static_cast<int>(m_ext_cnt)) {
@@ -381,11 +381,11 @@ int UnirecExporter::export_flow(const Flow &flow)
381381
tmplt_dbits |= (1 << ifc_num);
382382
}
383383

384-
if (m_ext_id_flgs[ext->m_ext_id] == 1){
385-
//send the previously filled unirec record
386-
trap_send(ifc_num, record_ptr, ur_rec_fixlen_size(tmplt_ptr) + ur_rec_varlen_size(tmplt_ptr, record_ptr));
387-
}else{
388-
m_ext_id_flgs[ext->m_ext_id] = 1;
384+
if (m_ext_id_flgs[ext->m_ext_id] == 1) {
385+
// send the previously filled unirec record
386+
trap_send(ifc_num, record_ptr, ur_rec_size(tmplt_ptr, record_ptr));
387+
} else {
388+
m_ext_id_flgs[ext->m_ext_id] = 1;
389389
}
390390

391391
fill_basic_flow(flow, tmplt_ptr, record_ptr);
@@ -394,10 +394,10 @@ int UnirecExporter::export_flow(const Flow &flow)
394394
ext = ext->m_next;
395395
}
396396
//send the last record with all plugin data
397-
for (size_t ifc_num = 0; ifc_num < m_ifc_cnt && !(m_basic_idx >= 0) && ext_processed_cnd > 0; ifc_num++){
398-
tmplt_ptr = m_tmplts[ifc_num];
399-
record_ptr = m_records[ifc_num];
400-
trap_send(ifc_num, record_ptr, ur_rec_fixlen_size(tmplt_ptr) + ur_rec_varlen_size(tmplt_ptr, record_ptr));
397+
for (size_t ifc_num = 0; ifc_num < m_ifc_cnt && !(m_basic_idx >= 0) && ext_processed_cnd > 0; ifc_num++) {
398+
tmplt_ptr = m_tmplts[ifc_num];
399+
record_ptr = m_records[ifc_num];
400+
trap_send(ifc_num, record_ptr, ur_rec_size(tmplt_ptr, record_ptr));
401401
}
402402
return 0;
403403
}

0 commit comments

Comments
 (0)