Skip to content

Commit c155323

Browse files
authored
Merge pull request #204 from astrorama/fix/output_number_of_sources
fixed regression in number of sources detected output
2 parents dc5b634 + 9b910b7 commit c155323

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

SEImplementation/SEImplementation/Output/TableOutput.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ class TableOutput : public Output {
4141
Euclid::Table::Table table {m_rows};
4242
m_table_handler(table);
4343
}
44-
auto written = m_rows.size();
44+
m_total_rows_written += m_rows.size();
4545
m_rows.clear();
46-
return written;
46+
return m_total_rows_written;
4747
}
4848

4949
TableOutput(SourceToRowConverter source_to_row, TableHandler table_handler, size_t flush_size)
50-
: m_source_to_row(source_to_row), m_table_handler(table_handler), m_flush_size(flush_size) {
50+
: m_source_to_row(source_to_row), m_table_handler(table_handler),
51+
m_flush_size(flush_size), m_total_rows_written(0) {
5152
}
5253

5354
void outputSource(const SourceInterface& source) override {
@@ -62,6 +63,7 @@ class TableOutput : public Output {
6263
TableHandler m_table_handler;
6364
std::vector<Euclid::Table::Row> m_rows {};
6465
size_t m_flush_size;
66+
size_t m_total_rows_written;
6567
};
6668

6769
} /* namespace SourceXtractor */

SEImplementation/src/lib/Configuration/OutputConfig.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,9 @@ void OutputConfig::initialize(const UserValues& args) {
7878

7979
auto& format = args.at(OUTPUT_FILE_FORMAT).as<std::string>();
8080
m_format = format_map.at(format);
81-
m_flush_size = args.at(OUTPUT_FLUSH_SIZE).as<int>();
82-
if (m_flush_size < 0) {
83-
m_flush_size = 0;
84-
}
81+
82+
int flush_size = args.at(OUTPUT_FLUSH_SIZE).as<int>();
83+
m_flush_size = (flush_size >= 0) ? flush_size : 0;
8584
}
8685

8786
std::string OutputConfig::getOutputFile() {

0 commit comments

Comments
 (0)