Skip to content

Commit

Permalink
DEV9: Fix function parameter should be passed by const reference warn…
Browse files Browse the repository at this point in the history
…ings.

Codacy.
  • Loading branch information
lightningterror committed Jul 1, 2024
1 parent bed31d3 commit 3f952c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions pcsx2/DEV9/PacketReader/IP/UDP/DHCP/DHCP_Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace PacketReader::IP::UDP::DHCP
NetLib::WriteByteArray(buffer, offset, dnsServers.size() * 4, (u8*)&dnsServers[0]);
}

DHCPopHostName::DHCPopHostName(std::string name)
DHCPopHostName::DHCPopHostName(const std::string& name)
{
if (name.size() > 255)
{
Expand Down Expand Up @@ -298,7 +298,7 @@ namespace PacketReader::IP::UDP::DHCP
NetLib::WriteByteArray(buffer, offset, requests.size(), &requests[0]);
}

DHCPopMSGStr::DHCPopMSGStr(std::string msg)
DHCPopMSGStr::DHCPopMSGStr(const std::string& msg)
{
if (msg.size() > 255)
{
Expand Down Expand Up @@ -375,7 +375,7 @@ namespace PacketReader::IP::UDP::DHCP
NetLib::WriteUInt32(buffer, offset, ipRebindingTimeT2);
}

DHCPopClassID::DHCPopClassID(std::string id)
DHCPopClassID::DHCPopClassID(const std::string& id)
{
if (id.size() > 255)
{
Expand Down
6 changes: 3 additions & 3 deletions pcsx2/DEV9/PacketReader/IP/UDP/DHCP/DHCP_Options.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ namespace PacketReader::IP::UDP::DHCP
//ASCII encoding
std::string hostName;

DHCPopHostName(std::string name);
DHCPopHostName(const std::string& name);
DHCPopHostName(u8* data, int offset); //Offset will include Kind and Len

virtual u8 GetLength() { return 2 + hostName.size(); }
Expand Down Expand Up @@ -276,7 +276,7 @@ namespace PacketReader::IP::UDP::DHCP
//ASCII encoding
std::string message;

DHCPopMSGStr(std::string msg);
DHCPopMSGStr(const std::string& msg);
DHCPopMSGStr(u8* data, int offset); //Offset will include Kind and Len

virtual u8 GetLength() { return 2 + message.size(); }
Expand Down Expand Up @@ -353,7 +353,7 @@ namespace PacketReader::IP::UDP::DHCP
//ASCII encoding
std::string classID;

DHCPopClassID(std::string id);
DHCPopClassID(const std::string& id);
DHCPopClassID(u8* data, int offset); //Offset will include Kind and Len

virtual u8 GetLength() { return 2 + classID.size(); }
Expand Down

0 comments on commit 3f952c8

Please sign in to comment.