Skip to content

Commit

Permalink
Fix to previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cvet committed Jan 16, 2025
1 parent df4ea76 commit 60d2a95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Source/Common/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -1370,7 +1370,7 @@ class DataReader
throw DataReadingException("Unexpected end of buffer");
}

T data = *reinterpret_cast<const T*>(&_dataBuf[_readPos]);
T data = *reinterpret_cast<const T*>(_dataBuf.data() + _readPos);
_readPos += sizeof(T);
return data;
}
Expand All @@ -1383,7 +1383,7 @@ class DataReader
}

if (size != 0) {
const T* ptr = reinterpret_cast<const T*>(&_dataBuf[_readPos]);
const T* ptr = reinterpret_cast<const T*>(_dataBuf.data() + _readPos);
_readPos += size;
return ptr;
}
Expand All @@ -1398,7 +1398,7 @@ class DataReader
throw DataReadingException("Unexpected end of buffer");
}

MemCopy(ptr, &_dataBuf[_readPos], sizeof(T));
MemCopy(ptr, _dataBuf.data() + _readPos, sizeof(T));
_readPos += sizeof(T);
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Common/StringUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ auto strex::startsWith(string_view r) const noexcept -> bool
{
NO_STACK_TRACE_ENTRY();

return _sv.length() >= r.length() && MemCompare(_sv.data(), r.data(), r.length()) == 0;
return _sv.length() >= r.length() && _sv.compare(0, r.length(), r) == 0;
}

auto strex::endsWith(char r) const noexcept -> bool
Expand Down

0 comments on commit 60d2a95

Please sign in to comment.