Przeglądaj źródła

Another small refactoring to remove duplicated code.

mingodad 8 lat temu
rodzic
commit
8f9367a8ee
1 zmienionych plików z 5 dodań i 5 usunięć
  1. 5 5
      SquiLu/squirrel/sqobject.h

+ 5 - 5
SquiLu/squirrel/sqobject.h

@@ -296,18 +296,18 @@ struct SQObjectPtr : public SQObject
 	    return _assignThis(obj);
 	}
 
+	inline bool isNull()
+	{
+		return _type == OT_NULL;
+	}
 	inline void Null()
 	{
-		if(_type != OT_NULL){
+		if(!isNull()){
 			__Release(_type,_unVal);
 			_type = OT_NULL;
 			_unVal.raw = (SQRawObjectVal)NULL;
 		}
 	}
-	inline bool isNull()
-	{
-		return _type == OT_NULL;
-	}
 	SQObjectPtr operator[](SQInteger nidx);
 	SQObjectPtr operator[](const SQChar *key);
 	private: