Skip to content

Commit

Permalink
Replace "not implemented" by assert
Browse files Browse the repository at this point in the history
  • Loading branch information
bansan85 committed Oct 22, 2023
1 parent aff4924 commit 79d3aaa
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/file-reader.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <cassert>

#include <ntfs-browser/file-reader.h>

#include "ntfs-common.h"
Expand Down Expand Up @@ -55,11 +57,8 @@ std::optional<std::span<const BYTE>> FileReader::Read(LARGE_INTEGER& addr,
if (strategy_ == Strategy::FULL_CACHE)
{
// Not implemented. Really needed ?
if (addr.QuadPart / BUFFER_SIZE !=
(addr.QuadPart + length - 1) / BUFFER_SIZE)
{
return {};
}
assert(addr.QuadPart / BUFFER_SIZE ==
(addr.QuadPart + length - 1) / BUFFER_SIZE);
LARGE_INTEGER addr2{.QuadPart =
addr.QuadPart - addr.QuadPart % BUFFER_SIZE};
DWORD len = SetFilePointer(handle_.get(), static_cast<LONG>(addr2.LowPart),
Expand Down

0 comments on commit 79d3aaa

Please sign in to comment.