Skip to content

Commit 9391fc4

Browse files
committed
clean
1 parent 75d2977 commit 9391fc4

File tree

5 files changed

+18
-17
lines changed

5 files changed

+18
-17
lines changed

src/odr/internal/common/table_cursor.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ namespace odr::internal {
77
TableCursor::TableCursor() noexcept { m_sparse.emplace_back(); }
88

99
void TableCursor::add_column(const uint32_t repeat) noexcept {
10-
m_col += repeat;
10+
m_column += repeat;
1111
}
1212

1313
void TableCursor::add_row(const std::uint32_t repeat) noexcept {
1414
m_row += repeat;
15-
m_col = 0;
15+
m_column = 0;
1616
if (repeat > 1) {
1717
// TODO assert trivial
1818
m_sparse.clear();
@@ -28,7 +28,7 @@ void TableCursor::add_row(const std::uint32_t repeat) noexcept {
2828
void TableCursor::add_cell(const std::uint32_t colspan,
2929
const std::uint32_t rowspan,
3030
const std::uint32_t repeat) noexcept {
31-
const auto new_next_cols = m_col + colspan * repeat;
31+
const std::uint32_t next_column = m_column + colspan * repeat;
3232

3333
// handle rowspan
3434
auto it = std::begin(m_sparse);
@@ -37,24 +37,26 @@ void TableCursor::add_cell(const std::uint32_t colspan,
3737
m_sparse.emplace_back();
3838
}
3939
++it;
40-
it->emplace_back(Range{m_col, new_next_cols});
40+
it->emplace_back(Range{m_column, next_column});
4141
}
4242

43-
m_col = new_next_cols;
43+
m_column = next_column;
4444
handle_rowspan_();
4545
}
4646

47-
TablePosition TableCursor::position() const noexcept { return {m_col, m_row}; }
47+
TablePosition TableCursor::position() const noexcept {
48+
return {m_column, m_row};
49+
}
4850

49-
std::uint32_t TableCursor::column() const noexcept { return m_col; }
51+
std::uint32_t TableCursor::column() const noexcept { return m_column; }
5052

5153
std::uint32_t TableCursor::row() const noexcept { return m_row; }
5254

5355
void TableCursor::handle_rowspan_() noexcept {
5456
auto &s = m_sparse.front();
5557
auto it = std::begin(s);
56-
while (it != std::end(s) && m_col == it->start) {
57-
m_col = it->end;
58+
while (it != std::end(s) && m_column == it->start) {
59+
m_column = it->end;
5860
++it;
5961
}
6062
s.erase(std::begin(s), it);

src/odr/internal/common/table_cursor.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ class TableCursor final {
2222

2323
private:
2424
struct Range {
25-
std::uint32_t start;
26-
std::uint32_t end;
25+
std::uint32_t start{0};
26+
std::uint32_t end{0};
2727
};
2828

29-
std::uint32_t m_col{0};
29+
std::uint32_t m_column{0};
3030
std::uint32_t m_row{0};
3131
std::list<std::list<Range>> m_sparse;
3232

src/odr/internal/common/table_range.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#include <odr/table_position.hpp>
44

5-
#include <cstdint>
65
#include <string>
76

87
namespace odr::internal {

src/odr/table_dimension.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace odr {
44

5-
TableDimensions::TableDimensions() = default;
5+
TableDimensions::TableDimensions() noexcept = default;
66

77
TableDimensions::TableDimensions(const std::uint32_t rows,
8-
const std::uint32_t columns)
8+
const std::uint32_t columns) noexcept
99
: rows{rows}, columns{columns} {}
1010

1111
} // namespace odr

src/odr/table_dimension.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ struct TableDimensions {
99
std::uint32_t rows{0};
1010
std::uint32_t columns{0};
1111

12-
TableDimensions();
13-
TableDimensions(std::uint32_t rows, std::uint32_t columns);
12+
TableDimensions() noexcept;
13+
TableDimensions(std::uint32_t rows, std::uint32_t columns) noexcept;
1414
};
1515

1616
} // namespace odr

0 commit comments

Comments
 (0)