Skip to content

Commit

Permalink
Merge pull request #445 from lifenjoiner/opz
Browse files Browse the repository at this point in the history
minor optimization
  • Loading branch information
stefankueng authored Feb 2, 2024
2 parents 75771c5 + b3e7261 commit dba47cf
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/SearchDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2164,9 +2164,9 @@ void CSearchDlg::ShowContextMenu(HWND hWnd, int x, int y)
auto subIdx = std::get<1>(tup);
data.path = info.filePath;
LineDataLine dataLine;
if (info.matchLinesNumbers.size() > subIdx)
if (static_cast<int>(info.matchLinesNumbers.size()) > subIdx)
dataLine.number = info.matchLinesNumbers[subIdx];
if (info.matchLines.size() > subIdx)
if (static_cast<int>(info.matchLines.size()) > subIdx)
dataLine.text = info.matchLines[subIdx];
data.lines.push_back(dataLine);
lines.push_back(data);
Expand Down Expand Up @@ -2337,7 +2337,7 @@ void CSearchDlg::DoListNotify(LPNMITEMACTIVATE lpNMItemActivate)
OpenFileAtListIndex(lpNMItemActivate->iItem);
}
}
if (lpNMItemActivate->hdr.code == LVN_ODSTATECHANGED)
else if (lpNMItemActivate->hdr.code == LVN_ODSTATECHANGED)
{
if (!m_bBlockUpdate)
{
Expand All @@ -2346,7 +2346,7 @@ void CSearchDlg::DoListNotify(LPNMITEMACTIVATE lpNMItemActivate)
UpdateInfoLabel();
}
}
if (lpNMItemActivate->hdr.code == LVN_ITEMCHANGED)
else if (lpNMItemActivate->hdr.code == LVN_ITEMCHANGED)
{
if ((lpNMItemActivate->uOldState & LVIS_SELECTED) || (lpNMItemActivate->uNewState & LVIS_SELECTED))
{
Expand All @@ -2358,7 +2358,7 @@ void CSearchDlg::DoListNotify(LPNMITEMACTIVATE lpNMItemActivate)
}
}
}
if (lpNMItemActivate->hdr.code == LVN_BEGINDRAG)
else if (lpNMItemActivate->hdr.code == LVN_BEGINDRAG)
{
CDropFiles dropFiles; // class for creating DROPFILES struct

Expand All @@ -2379,7 +2379,7 @@ void CSearchDlg::DoListNotify(LPNMITEMACTIVATE lpNMItemActivate)
dropFiles.CreateStructure(hListControl);
}
}
if (lpNMItemActivate->hdr.code == LVN_COLUMNCLICK)
else if (lpNMItemActivate->hdr.code == LVN_COLUMNCLICK)
{
bool fileList = (IsDlgButtonChecked(*this, IDC_RESULTFILES) == BST_CHECKED);
m_bAscending = !m_bAscending;
Expand Down Expand Up @@ -2488,7 +2488,7 @@ void CSearchDlg::DoListNotify(LPNMITEMACTIVATE lpNMItemActivate)
SendMessage(hListControl, WM_SETREDRAW, TRUE, 0);
RedrawWindow(hListControl, nullptr, nullptr, RDW_ERASE | RDW_FRAME | RDW_INVALIDATE | RDW_ALLCHILDREN);
}
if (lpNMItemActivate->hdr.code == LVN_GETINFOTIP)
else if (lpNMItemActivate->hdr.code == LVN_GETINFOTIP)
{
NMLVGETINFOTIP* pInfoTip = reinterpret_cast<NMLVGETINFOTIP*>(lpNMItemActivate);

Expand Down Expand Up @@ -2522,7 +2522,7 @@ void CSearchDlg::DoListNotify(LPNMITEMACTIVATE lpNMItemActivate)
wcsncpy_s(pInfoTip->pszText, pInfoTip->cchTextMax, matchString.c_str(), pInfoTip->cchTextMax - 1LL);
}
}
if (lpNMItemActivate->hdr.code == LVN_GETDISPINFO)
else if (lpNMItemActivate->hdr.code == LVN_GETDISPINFO)
{
static const std::wstring sBinary = TranslatedString(hResource, IDS_BINARY);
static const std::wstring sReadError = TranslatedString(hResource, IDS_READERROR);
Expand Down

0 comments on commit dba47cf

Please sign in to comment.