Ivan Savenko пре 1 година
родитељ
комит
4e654a7e6e
2 измењених фајлова са 6 додато и 6 уклоњено
  1. 3 3
      lib/serializer/BinaryDeserializer.h
  2. 3 3
      lib/serializer/BinarySerializer.h

+ 3 - 3
lib/serializer/BinaryDeserializer.h

@@ -226,9 +226,9 @@ public:
 	template < typename T, typename std::enable_if < std::is_pointer<T>::value, int  >::type = 0 >
 	void load(T &data)
 	{
-		ui8 hlp;
-		load( hlp );
-		if(!hlp)
+		bool isNull;
+		load( isNull );
+		if(isNull)
 		{
 			data = nullptr;
 			return;

+ 3 - 3
lib/serializer/BinarySerializer.h

@@ -174,11 +174,11 @@ public:
 	void save(const T &data)
 	{
 		//write if pointer is not nullptr
-		ui8 hlp = (data!=nullptr);
-		save(hlp);
+		bool isNull = (data == nullptr);
+		save(isNull);
 
 		//if pointer is nullptr then we don't need anything more...
-		if(!hlp)
+		if(data == nullptr)
 			return;
 
 		savePointerImpl(data);