diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2023-07-08 21:41:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-08 21:41:27 +0200 |
commit | a68f48ad526d0843eb451af0be7f119db5ff794e (patch) | |
tree | 3c539c9e7de841c6616f532dadb7c8c1ef552d95 /src/Block.hpp | |
parent | Merge pull request #80 from LaG1924/ftr/better-water (diff) | |
parent | Fixed some errors detected by static analysis (diff) | |
download | AltCraft-master.tar AltCraft-master.tar.gz AltCraft-master.tar.bz2 AltCraft-master.tar.lz AltCraft-master.tar.xz AltCraft-master.tar.zst AltCraft-master.zip |
Diffstat (limited to 'src/Block.hpp')
-rw-r--r-- | src/Block.hpp | 8 |
1 files changed, 4 insertions, 4 deletions
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<BlockId> { - std::size_t operator()(const BlockId& k) const { + std::size_t operator()(BlockId k) const { size_t id = std::hash<unsigned short>()(k.id); size_t state = std::hash<unsigned char>()(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); |