Skip to content

Commit

Permalink
Reduce the complexity of some methods
Browse files Browse the repository at this point in the history
  • Loading branch information
gansm committed Nov 23, 2023
1 parent 3e24a01 commit 219b9b4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion final/widget/ftextview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ inline void FTextView::processLine (FString&& line, int pos)
}

//----------------------------------------------------------------------
inline void FTextView::updateVerticalScrollBar()
inline void FTextView::updateVerticalScrollBar() const
{
const int vmax = ( getRows() > getTextHeight() )
? int(getRows()) - int(getTextHeight())
Expand Down
2 changes: 1 addition & 1 deletion final/widget/ftextview.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class FTextView : public FWidget
auto isPrintable (wchar_t) const -> bool;
auto splitTextLines (const FString&) const -> FStringList;
void processLine (FString&&, int);
void updateVerticalScrollBar();
void updateVerticalScrollBar() const;
void updateHorizontalScrollBar (std::size_t);
void processChanged() const;
void changeOnResize() const;
Expand Down
7 changes: 5 additions & 2 deletions test/fkeyboard-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3172,8 +3172,11 @@ void FKeyboardTest::init()
auto& fkey_cap_table = finalcut::FKeyMap::getInstance().getKeyCapMap();
std::size_t first = 150;
std::size_t last = fkey_cap_table.size() - 1;
assert ( last > first );
std::copy ( &fkey_cap_table[first].num, &fkey_cap_table[last].num, &test::fkey[first].num);
const auto from_begin = &fkey_cap_table[first];
const auto from_end = &fkey_cap_table[last] + 1;
auto to_begin = &test::fkey[first];
assert ( from_end > from_begin );
std::copy (from_begin, from_end, to_begin);

// Use test::fkey as new termcap map
keyboard->setTermcapMap (test::fkey);
Expand Down

0 comments on commit 219b9b4

Please sign in to comment.