Pattern matching so hot right now

This commit is contained in:
cinder
2022-10-10 16:30:12 -05:00
parent 472ac122f8
commit 972e588d75
4 changed files with 7 additions and 15 deletions

View File

@@ -460,9 +460,8 @@ namespace OpenMetaverse
public static ParticleSystem FromOSD(OSD osd)
{
ParticleSystem partSys = new ParticleSystem();
OSDMap map = osd as OSDMap;
if (map != null)
if (osd is OSDMap map)
{
partSys.CRC = map["crc"].AsUInteger();
partSys.PartFlags = map["part_flags"].AsUInteger();