Remove Some Redundant Code

This commit is contained in:
Ben C 2022-10-18 14:01:36 -04:00
parent 728f8d7ffe
commit 943f242e4e

View File

@ -134,9 +134,8 @@ namespace NewHorizons
var data = QueryBody(typeof(T), bodyName, jsonPath); var data = QueryBody(typeof(T), bodyName, jsonPath);
if (data is T result) { if (data is T result) {
return result; return result;
} else {
return default(T);
} }
return default;
} }
public object QuerySystem(Type outType, string jsonPath) public object QuerySystem(Type outType, string jsonPath)
@ -151,9 +150,8 @@ namespace NewHorizons
var data = QuerySystem(typeof(T), jsonPath); var data = QuerySystem(typeof(T), jsonPath);
if (data is T result) { if (data is T result) {
return result; return result;
} else {
return default(T);
} }
return default;
} }
public GameObject SpawnObject(GameObject planet, Sector sector, string propToCopyPath, Vector3 position, Vector3 eulerAngles, public GameObject SpawnObject(GameObject planet, Sector sector, string propToCopyPath, Vector3 position, Vector3 eulerAngles,