Remove unnecessary null checks and added missing return statement

This commit is contained in:
EvilFactory
2022-10-07 11:30:59 -03:00
parent 8fef89a255
commit 18ee41c610
@@ -246,7 +246,7 @@ namespace Barotrauma
{ {
if (option.TryUnwrap(out T outValue)) if (option.TryUnwrap(out T outValue))
{ {
return outValue == null ? DynValue.Nil : UserData.Create(outValue); return UserData.Create(outValue);
} }
} }
@@ -262,7 +262,7 @@ namespace Barotrauma
{ {
if (obj is Some<T> some) if (obj is Some<T> some)
{ {
return some.Value == null ? DynValue.Nil : UserData.Create(some.Value); return UserData.Create(some.Value);
} }
return null; return null;
@@ -276,10 +276,8 @@ namespace Barotrauma
} }
else else
{ {
Option<T>.Some(v.ToObject<T>()); return Option<T>.Some(v.ToObject<T>());
} }
return null;
}); });
} }