Formatting #2 (#59)

This commit is contained in:
Kamron Batman 2019-10-05 00:37:03 -07:00 committed by GitHub
parent 096d39609e
commit 8e9221bb5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
400 changed files with 3688 additions and 5969 deletions

View file

@ -57,14 +57,13 @@ namespace Server
{
int type = reader.ReadEncodedInt();
switch (type)
return type switch
{
case 0: return new TextDefinition();
case 1: return new TextDefinition(reader.ReadEncodedInt());
case 2: return new TextDefinition(reader.ReadString());
}
return null;
0 => new TextDefinition(),
1 => new TextDefinition(reader.ReadEncodedInt()),
2 => new TextDefinition(reader.ReadString()),
_ => null
};
}
public static void AddTo(ObjectPropertyList list, TextDefinition def)
@ -163,6 +162,6 @@ namespace Server
return isInteger ? new TextDefinition(i) : new TextDefinition(value);
}
public static bool IsNullOrEmpty(TextDefinition def) => def == null || def.IsEmpty;
public static bool IsNullOrEmpty(TextDefinition def) => def?.IsEmpty != false;
}
}