From 703e3c42d11a74be69cc1dee560e2c0f359ac13f Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sat, 8 Jan 2011 17:45:31 +0000 Subject: [PATCH] remove always-true tests of unsigned >= 0 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66655 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/richtext/richtextbuffer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 924074a586..04a62fab25 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -291,13 +291,13 @@ wxRect wxRichTextFloatCollector::GetAvailableRect(int startY, int endY) if (m_left.GetCount() != 0) { unsigned int i = SearchAdjacentRect(m_left, startY); - if (i >= 0 && i < m_left.GetCount()) + if (i < m_left.GetCount()) widthLeft = GetWidthFromFloatRect(m_left, i, startY, endY); } if (m_right.GetCount() != 0) { unsigned int j = SearchAdjacentRect(m_right, startY); - if (j >= 0 && j < m_right.GetCount()) + if (j < m_right.GetCount()) widthRight = GetWidthFromFloatRect(m_right, j, startY, endY); } @@ -325,10 +325,10 @@ void wxRichTextFloatCollector::DrawFloat(const wxRichTextFloatRectMapArray& arra int end = rect.y + rect.height; unsigned int i, j; i = SearchAdjacentRect(array, start); - if (i < 0 || i >= array.GetCount()) + if (i >= array.GetCount()) return; j = SearchAdjacentRect(array, end); - if (j < 0 || j >= array.GetCount()) + if (j >= array.GetCount()) j = array.GetCount() - 1; while (i <= j) { @@ -353,7 +353,7 @@ int wxRichTextFloatCollector::HitTestFloat(const wxRichTextFloatRectMapArray& ar if (array.GetCount() == 0) return wxRICHTEXT_HITTEST_NONE; i = SearchAdjacentRect(array, pt.y); - if (i < 0 || i >= array.GetCount()) + if (i >= array.GetCount()) return wxRICHTEXT_HITTEST_NONE; wxPoint point = array[i]->anchor->GetPosition(); wxSize size = array[i]->anchor->GetCachedSize(); -- 2.45.2