From c984afdf47ef31511024c6b70bd4b4c4e64f56a6 Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Sat, 8 Jul 2023 23:30:25 +0500 Subject: Fixed some errors detected by static analysis --- src/Block.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Block.hpp') diff --git a/src/Block.hpp b/src/Block.hpp index 535ae68..c1883ab 100644 --- a/src/Block.hpp +++ b/src/Block.hpp @@ -19,11 +19,11 @@ enum BlockFacing { East }; -inline bool operator==(const BlockId& lhs, const BlockId &rhs) { +inline bool operator==(BlockId lhs, BlockId rhs) { return (lhs.id == rhs.id) && (lhs.state == rhs.state); } -inline bool operator<(const BlockId& lhs, const BlockId &rhs) { +inline bool operator<(BlockId lhs, BlockId rhs) { if (lhs.id != rhs.id) return lhs.id < rhs.id; return lhs.state < rhs.state; @@ -32,7 +32,7 @@ inline bool operator<(const BlockId& lhs, const BlockId &rhs) { namespace std { template <> struct hash { - std::size_t operator()(const BlockId& k) const { + std::size_t operator()(BlockId k) const { size_t id = std::hash()(k.id); size_t state = std::hash()(k.state); @@ -54,7 +54,7 @@ struct LiquidInfo { void RegisterStaticBlockInfo(BlockId blockId, BlockInfo blockInfo); -void RegisterStaticLiquidInfo(BlockId blockId, LiquidInfo liquidInfo); +void RegisterStaticLiquidInfo(BlockId blockId, const LiquidInfo& liquidInfo); BlockInfo* GetBlockInfo(BlockId blockId); -- cgit v1.2.3