Skip to content

Commit

Permalink
Merge pull request dolphin-emu#5329 from leoetlino/clear
Browse files Browse the repository at this point in the history
IOS/ES: Drop unnecessary memset for vectors
  • Loading branch information
leoetlino authored Apr 27, 2017
2 parents 9fc394f + 65d37ee commit 8028564
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 14 deletions.
6 changes: 0 additions & 6 deletions Source/Core/Core/IOS/Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ IOCtlVRequest::IOCtlVRequest(const u32 address_) : Request(address_)
}
}

bool IOCtlVRequest::HasInputVectorWithAddress(const u32 vector_address) const
{
return std::any_of(in_vectors.begin(), in_vectors.end(),
[&](const auto& in_vector) { return in_vector.address == vector_address; });
}

bool IOCtlVRequest::HasNumberOfValidVectors(const size_t in_count, const size_t io_count) const
{
if (in_vectors.size() != in_count || io_vectors.size() != io_count)
Expand Down
1 change: 0 additions & 1 deletion Source/Core/Core/IOS/Device.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ struct IOCtlVRequest final : Request
std::vector<IOVector> in_vectors;
std::vector<IOVector> io_vectors;
explicit IOCtlVRequest(u32 address);
bool HasInputVectorWithAddress(u32 vector_address) const;
bool HasNumberOfValidVectors(size_t in_count, size_t io_count) const;
void Dump(const std::string& description, LogTypes::LOG_TYPE type = LogTypes::IOS,
LogTypes::LOG_LEVELS level = LogTypes::LINFO) const;
Expand Down
7 changes: 0 additions & 7 deletions Source/Core/Core/IOS/ES/ES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,6 @@ IPCCommandResult ES::IOCtlV(const IOCtlVRequest& request)
{
DEBUG_LOG(IOS_ES, "%s (0x%x)", GetDeviceName().c_str(), request.request);

// Clear the IO buffers. Note that this is unsafe for other ioctlvs.
for (const auto& io_vector : request.io_vectors)
{
if (!request.HasInputVectorWithAddress(io_vector.address))
Memory::Memset(io_vector.address, 0, io_vector.size);
}

switch (request.request)
{
case IOCTL_ES_ADDTICKET:
Expand Down

0 comments on commit 8028564

Please sign in to comment.