Skip to content

Commit

Permalink
CGridListCtrlEx - OnKeyboardSearch - Minor optimization in CString al…
Browse files Browse the repository at this point in the history
…locations
  • Loading branch information
snakefoot committed Mar 13, 2016
1 parent 46279a3 commit 292f4e2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions CGridListCtrlEx/CGridListCtrlEx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1844,11 +1844,10 @@ int CGridListCtrlEx::OnKeyboardSearch(int nCol, int nStartRow, const CString& st
{
for (int i = nStartRow; i < nRowCount; ++i)
{
CString cellText = GetItemText(i, nCol);
const CString& cellText = GetItemText(i, nCol);
if (cellText.GetLength() >= strSearch.GetLength())
{
cellText = cellText.Left(strSearch.GetLength());
if (cellText.CompareNoCase(strSearch) == 0)
if (_tcsnicmp(cellText, strSearch, strSearch.GetLength()) == 0)
return i;
}
}
Expand Down

0 comments on commit 292f4e2

Please sign in to comment.