Skip to content

Commit

Permalink
GetIHexTData simplification.
Browse files Browse the repository at this point in the history
  • Loading branch information
jovibor committed Jan 3, 2022
1 parent ee13d05 commit 93633d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion HexCtrl/src/CHexCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3319,7 +3319,7 @@ void CHexCtrl::DrawPageLines(CDC* pDC, ULONGLONG ullStartLine, int iLines)
if ((((ullStartLine + iterLines) * m_dwCapacity) % m_dwPageSize == 0) && iterLines > 0)
{
const auto iPosToPrintY = m_iStartWorkAreaY + m_sizeLetter.cy * iterLines;
vecPageLines.emplace_back(SPAGELINES { { m_iFirstVertLine, iPosToPrintY }, { m_iFourthVertLine, iPosToPrintY } });
vecPageLines.emplace_back(POINT { m_iFirstVertLine, iPosToPrintY }, POINT { m_iFourthVertLine, iPosToPrintY });
}
}

Expand Down
6 changes: 1 addition & 5 deletions HexCtrl/src/HexUtility.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,9 @@ namespace HEXCTRL::INTERNAL
template<typename T>
[[nodiscard]] inline T GetIHexTData(const IHexCtrl& refHexCtrl, ULONGLONG ullOffset)
{
T tData { };
const auto spnData = refHexCtrl.GetData({ ullOffset, sizeof(T) });
assert(!spnData.empty());
if (!spnData.empty())
tData = *reinterpret_cast<T*>(spnData.data());

return tData;
return *reinterpret_cast<T*>(spnData.data());
}

//Set data of a necessary type to IHexCtrl's given offset.
Expand Down

0 comments on commit 93633d7

Please sign in to comment.