Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor optimization #445

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading