From fab945d0c0f403cbd4e459f8b9ab7d1880b34f83 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 8 Sep 2023 19:27:55 +0100 Subject: Use built-in Ice read/write for optionals --- slicer/slicer/modelPartsTypes.impl.h | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/slicer/slicer/modelPartsTypes.impl.h b/slicer/slicer/modelPartsTypes.impl.h index 0342cb0..77d542d 100644 --- a/slicer/slicer/modelPartsTypes.impl.h +++ b/slicer/slicer/modelPartsTypes.impl.h @@ -134,12 +134,8 @@ namespace Slicer { typeWrite(::Ice::OutputStream & s, const ::Ice::optional & m) { if constexpr (!isLocal::value) { - using traits = Ice::StreamableTraits; - using SOH = Ice::StreamOptionalHelper; s.startEncapsulation(); - if (m && s.writeOptional(0, SOH::optionalFormat)) { - SOH::write(&s, *m); - } + s.write(0, m); s.endEncapsulation(); } else { @@ -164,16 +160,8 @@ namespace Slicer { typeRead(::Ice::InputStream & s, ::Ice::optional & m) { if constexpr (!isLocal::value) { - using traits = Ice::StreamableTraits; - using SOH = Ice::StreamOptionalHelper; s.startEncapsulation(); - if (s.readOptional(0, SOH::optionalFormat)) { - m = T(); - SOH::read(&s, *m); - } - else { - m = IceUtil::None; - } + s.read(0, m); s.endEncapsulation(); } else { -- cgit v1.2.3