diff options
author | Jozef Behran <jozuejozef@gmail.com> | 2019-03-07 02:19:13 -0500 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2019-03-07 08:19:13 +0100 |
commit | 007c8440d7da324af05631389f9a850e805fb3b3 (patch) | |
tree | 066cb97985c1dbcdbfa6bd730c66f1483192ea48 /src/network/serverpackethandler.cpp | |
parent | 557afdc42979916c54d9e1240845dcce3726721e (diff) | |
download | minetest-007c8440d7da324af05631389f9a850e805fb3b3.tar.gz minetest-007c8440d7da324af05631389f9a850e805fb3b3.tar.bz2 minetest-007c8440d7da324af05631389f9a850e805fb3b3.zip |
Optimize interaction distance checker (#8193)
The "what" parameter is being passed by value, most likely by
accident as the type is "const std::string". Convert it to a
reference by adding the missing "&".
Diffstat (limited to 'src/network/serverpackethandler.cpp')
-rw-r--r-- | src/network/serverpackethandler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index 6f17d666a..7e9495d16 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -952,7 +952,7 @@ void Server::handleCommand_Respawn(NetworkPacket* pkt) // the previous addition has been successfully removed } -bool Server::checkInteractDistance(RemotePlayer *player, const f32 d, const std::string what) +bool Server::checkInteractDistance(RemotePlayer *player, const f32 d, const std::string &what) { PlayerSAO *playersao = player->getPlayerSAO(); const InventoryList *hlist = playersao->getInventory()->getList("hand"); |