diff --git a/src/common/Rect.hxx b/src/common/Rect.hxx index 869cc5e75..708de9d86 100644 --- a/src/common/Rect.hxx +++ b/src/common/Rect.hxx @@ -32,7 +32,6 @@ namespace Common { */ struct Point { - // FIXME : make this uInt32 Int32 x{0}; //!< The horizontal part of the point Int32 y{0}; //!< The vertical part of the point diff --git a/src/common/bspf.hxx b/src/common/bspf.hxx index 44d649869..5abe26dd3 100644 --- a/src/common/bspf.hxx +++ b/src/common/bspf.hxx @@ -170,10 +170,10 @@ namespace BSPF return (val < lower) ? upper : (val > upper) ? lower : val; } - // Test whether the vector contains the given value - template - bool contains(const std::vector& v, const T& elem) { - return !(v.empty() || std::find(v.begin(), v.end(), elem) == v.end()); + // Test whether a container contains the given value + template + bool contains(const Container& c, typename Container::const_reference elem) { + return std::find(c.cbegin(), c.cend(), elem) != c.end(); } // Convert string to given case diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx index d568c14cb..98120cae4 100644 --- a/src/gui/Widget.cxx +++ b/src/gui/Widget.cxx @@ -316,8 +316,7 @@ bool Widget::isWidgetInChain(Widget* w, Widget* find) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool Widget::isWidgetInChain(const WidgetArray& list, Widget* find) { - return std::any_of(list.cbegin(), list.cend(), - [&](Widget* w) { return w == find; }); + return BSPF::contains(list, find); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -