diff --git a/include/ftxui/screen/box.hpp b/include/ftxui/screen/box.hpp index 9fc27921549ae2cae4ef2f293f8da0990f95866b..37708038d4afc5aedc8e9ce6de97de7028b70ab2 100644 --- a/include/ftxui/screen/box.hpp +++ b/include/ftxui/screen/box.hpp @@ -15,7 +15,7 @@ struct Box { static auto Intersection(Box a, Box b) -> Box; static auto Union(Box a, Box b) -> Box; bool Contain(int x, int y) const; - bool IsEmpty(); + bool IsEmpty() const; bool operator==(const Box& other) const; bool operator!=(const Box& other) const; }; diff --git a/src/ftxui/component/dropdown.cpp b/src/ftxui/component/dropdown.cpp index 5f96580788023a2bf534ebb5de2dfab69f4b79e0..e105852881440efdde1c0d4272023a1dd09c7494 100644 --- a/src/ftxui/component/dropdown.cpp +++ b/src/ftxui/component/dropdown.cpp @@ -32,7 +32,7 @@ Component Dropdown(ConstStringListRef entries, int* selected) { Component Dropdown(DropdownOption option) { class Impl : public ComponentBase, public DropdownOption { public: - Impl(DropdownOption option) : DropdownOption(std::move(option)) { + explicit Impl(DropdownOption option) : DropdownOption(std::move(option)) { FillDefault(); checkbox_ = Checkbox(checkbox); radiobox_ = Radiobox(radiobox); @@ -71,8 +71,8 @@ Component Dropdown(DropdownOption option) { } void FillDefault() { - open_ = std::move(checkbox.checked); - selected_ = std::move(radiobox.selected); + open_ = checkbox.checked; + selected_ = radiobox.selected; checkbox.checked = &*open_; radiobox.selected = &*selected_; diff --git a/src/ftxui/screen/box.cpp b/src/ftxui/screen/box.cpp index 0210153b05e0242a51d9961c82b46f03123a7a70..e190305ed39e86240b1b006d8c7b20a4b810ad39 100644 --- a/src/ftxui/screen/box.cpp +++ b/src/ftxui/screen/box.cpp @@ -41,7 +41,7 @@ bool Box::Contain(int x, int y) const { /// @return whether the box is empty. /// @ingroup screen -bool Box::IsEmpty() { +bool Box::IsEmpty() const { return x_min > x_max || y_min > y_max; }