summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/BlockEntities/EnderChestEntity.cpp4
-rw-r--r--src/Protocol/Protocol17x.cpp8
-rw-r--r--src/Protocol/Protocol18x.cpp8
-rw-r--r--src/WorldStorage/StatSerializer.cpp4
4 files changed, 12 insertions, 12 deletions
diff --git a/src/BlockEntities/EnderChestEntity.cpp b/src/BlockEntities/EnderChestEntity.cpp
index 00e203520..8783c1610 100644
--- a/src/BlockEntities/EnderChestEntity.cpp
+++ b/src/BlockEntities/EnderChestEntity.cpp
@@ -75,10 +75,10 @@ void cEnderChestEntity::OpenNewWindow()
void cEnderChestEntity::LoadFromJson(const Json::Value & a_Value, cItemGrid & a_Grid)
{
int SlotIdx = 0;
- for (Json::Value::iterator itr = a_Value.begin(); itr != a_Value.end(); ++itr)
+ for (auto & Node : a_Value)
{
cItem Item;
- Item.FromJson(*itr);
+ Item.FromJson(Node);
a_Grid.SetSlot(SlotIdx, Item);
SlotIdx++;
}
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index d17537ff7..8dd608069 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -3222,11 +3222,11 @@ void cProtocol176::SendPlayerSpawn(const cPlayer & a_Player)
const Json::Value & Properties = a_Player.GetClientHandle()->GetProperties();
Pkt.WriteVarInt32(Properties.size());
- for (Json::Value::iterator itr = Properties.begin(), end = Properties.end(); itr != end; ++itr)
+ for (auto & Node : Properties)
{
- Pkt.WriteString(itr->get("name", "").asString());
- Pkt.WriteString(itr->get("value", "").asString());
- Pkt.WriteString(itr->get("signature", "").asString());
+ Pkt.WriteString(Node.get("name", "").asString());
+ Pkt.WriteString(Node.get("value", "").asString());
+ Pkt.WriteString(Node.get("signature", "").asString());
}
Pkt.WriteFPInt(a_Player.GetPosX());
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp
index ea71103f7..81e9bc1bc 100644
--- a/src/Protocol/Protocol18x.cpp
+++ b/src/Protocol/Protocol18x.cpp
@@ -853,11 +853,11 @@ void cProtocol180::SendPlayerListAddPlayer(const cPlayer & a_Player)
const Json::Value & Properties = a_Player.GetClientHandle()->GetProperties();
Pkt.WriteVarInt32(Properties.size());
- for (Json::Value::iterator itr = Properties.begin(), end = Properties.end(); itr != end; ++itr)
+ for (auto & Node : Properties)
{
- Pkt.WriteString(static_cast<Json::Value>(*itr).get("name", "").asString());
- Pkt.WriteString(static_cast<Json::Value>(*itr).get("value", "").asString());
- AString Signature = static_cast<Json::Value>(*itr).get("signature", "").asString();
+ Pkt.WriteString(Node.get("name", "").asString());
+ Pkt.WriteString(Node.get("value", "").asString());
+ AString Signature = Node.get("signature", "").asString();
if (Signature.empty())
{
Pkt.WriteBool(false);
diff --git a/src/WorldStorage/StatSerializer.cpp b/src/WorldStorage/StatSerializer.cpp
index 29f9b3cd6..16128966b 100644
--- a/src/WorldStorage/StatSerializer.cpp
+++ b/src/WorldStorage/StatSerializer.cpp
@@ -102,7 +102,7 @@ bool cStatSerializer::LoadStatFromJSON(const Json::Value & a_In)
{
m_Manager->Reset();
- for (Json::ValueIterator it = a_In.begin() ; it != a_In.end() ; ++it)
+ for (Json::Value::const_iterator it = a_In.begin() ; it != a_In.end() ; ++it)
{
AString StatName = it.key().asString();
@@ -114,7 +114,7 @@ bool cStatSerializer::LoadStatFromJSON(const Json::Value & a_In)
continue;
}
- Json::Value & Node = *it;
+ const Json::Value & Node = *it;
if (Node.isInt())
{