Apply suggestion from @kamronbatman

This commit is contained in:
Kamron Batman 2026-06-25 23:42:32 -07:00 committed by GitHub
parent 15e77506c5
commit b8e2b2d0be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -175,9 +175,6 @@ public class Rectangle3DConverter : JsonConverter<Rectangle3D>
public override void Write(Utf8JsonWriter writer, Rectangle3D value, JsonSerializerOptions options)
{
// Omit z only for the exact full-range sentinel DeserializeObj reconstructs when z is absent
// (z1 == -128, z2 == 127). Any other z must be written, otherwise it round-trips to that
// sentinel and is corrupted (e.g. a homeRange-style z1=-128/z2=128 would lose a z-level).
var writeZ = value.Start.Z != sbyte.MinValue || value.End.Z != sbyte.MaxValue;
writer.WriteStartObject();