Jorrit Rouwe vor 3 Jahren
Ursprung
Commit
448cc01ec7

+ 2 - 1
Jolt/ObjectStream/ObjectStreamBinaryIn.cpp

@@ -140,7 +140,8 @@ bool ObjectStreamBinaryIn::ReadPrimitiveData(string &outPrimitive)
 	outPrimitive = data;
 	outPrimitive = data;
 
 
 	// Insert string in table
 	// Insert string in table
-	mStringTable.try_emplace(mNextStringID++, outPrimitive);
+	mStringTable.try_emplace(mNextStringID, outPrimitive);
+	mNextStringID++;
 	return true;
 	return true;
 }
 }
 
 

+ 2 - 1
Jolt/ObjectStream/ObjectStreamBinaryOut.cpp

@@ -90,7 +90,8 @@ void ObjectStreamBinaryOut::WritePrimitiveData(const string &inPrimitive)
 	}
 	}
 
 
 	// Insert string in table
 	// Insert string in table
-	mStringTable.try_emplace(inPrimitive, mNextStringID++);
+	mStringTable.try_emplace(inPrimitive, mNextStringID);
+	mNextStringID++;
 
 
 	// Write string
 	// Write string
 	uint32 len = min((uint32)inPrimitive.size(), (uint32)0x7fffffff);
 	uint32 len = min((uint32)inPrimitive.size(), (uint32)0x7fffffff);

+ 2 - 1
Jolt/ObjectStream/ObjectStreamOut.cpp

@@ -34,7 +34,8 @@ ObjectStreamOut *ObjectStreamOut::Open(EStreamType inType, ostream &inStream)
 bool ObjectStreamOut::Write(const void *inObject, const RTTI *inRTTI)
 bool ObjectStreamOut::Write(const void *inObject, const RTTI *inRTTI)
 {
 {
 	// Assign a new identifier to the object and write it
 	// Assign a new identifier to the object and write it
-	mIdentifierMap.try_emplace(inObject, mNextIdentifier++, inRTTI);
+	mIdentifierMap.try_emplace(inObject, mNextIdentifier, inRTTI);
+	mNextIdentifier++;
 	WriteObject(inObject);
 	WriteObject(inObject);
 
 
 	// Write all linked objects
 	// Write all linked objects