From 189ef770eb9a5aab8f42f2db1f38a5377d235afe Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Wed, 30 Nov 2022 18:57:27 +0000 Subject: [PATCH] Use ternary for vp_query_cell This works because CA wanted us to capture the return var, which we are just discarding. VP sometimes you are cursed but in a good way --- VpSharp/src/VirtualParadiseClient.Objects.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/VpSharp/src/VirtualParadiseClient.Objects.cs b/VpSharp/src/VirtualParadiseClient.Objects.cs index 7734cf2..0db2532 100644 --- a/VpSharp/src/VirtualParadiseClient.Objects.cs +++ b/VpSharp/src/VirtualParadiseClient.Objects.cs @@ -33,14 +33,9 @@ public sealed partial class VirtualParadiseClient lock (Lock) { - if (revision is not null) - { - vp_query_cell_revision(NativeInstanceHandle, cell.X, cell.Z, revision.Value); - } - else - { - vp_query_cell(NativeInstanceHandle, cell.X, cell.Z); - } + _ = revision is not null + ? vp_query_cell_revision(NativeInstanceHandle, cell.X, cell.Z, revision.Value) + : vp_query_cell(NativeInstanceHandle, cell.X, cell.Z); } return channel.Reader.ReadAllAsync(); @@ -106,7 +101,7 @@ public sealed partial class VirtualParadiseClient lock (Lock) { _ = vp_int_set(NativeInstanceHandle, IntegerAttribute.ReferenceNumber, id); - reason = (ReasonCode) vp_object_get(NativeInstanceHandle, id); + reason = (ReasonCode)vp_object_get(NativeInstanceHandle, id); if (reason != ReasonCode.Success) { goto PreReturn;