From 93633d76217806c4a4bc6916ad16b28a778ad4cc Mon Sep 17 00:00:00 2001 From: Jovibor Date: Mon, 3 Jan 2022 19:16:17 +1000 Subject: [PATCH] GetIHexTData simplification. --- HexCtrl/src/CHexCtrl.cpp | 2 +- HexCtrl/src/HexUtility.h | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/HexCtrl/src/CHexCtrl.cpp b/HexCtrl/src/CHexCtrl.cpp index ffe88372..bf26b4d2 100644 --- a/HexCtrl/src/CHexCtrl.cpp +++ b/HexCtrl/src/CHexCtrl.cpp @@ -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 }); } } diff --git a/HexCtrl/src/HexUtility.h b/HexCtrl/src/HexUtility.h index c8e3eb1a..ab6b4c61 100644 --- a/HexCtrl/src/HexUtility.h +++ b/HexCtrl/src/HexUtility.h @@ -72,13 +72,9 @@ namespace HEXCTRL::INTERNAL template [[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(spnData.data()); - - return tData; + return *reinterpret_cast(spnData.data()); } //Set data of a necessary type to IHexCtrl's given offset.