From d035a293b7e4555597bcf5940e8a98f278a2143e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 29 Jul 2016 22:20:01 -0400 Subject: Use more terse patch:Put for canvas positions Fix the semantics of PUT events for existing objects to match the documentation. --- src/server/events/Delta.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/server/events/Delta.cpp') diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index 0ef63d64..641525e1 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -298,15 +298,9 @@ Delta::pre_process() } // Remove all added properties if this is a put or set - if (_object) { - if (_type == Type::PUT) { - for (const auto& p : _properties) { - _object->remove_property(p.first, p.second); - } - } else if (_type == Type::SET) { - for (const auto& p : _properties) { - _object->remove_property(p.first, uris.patch_wildcard); - } + if (_object && (_type == Type::PUT || _type == Type::SET)) { + for (const auto& p : _properties) { + _object->remove_property(p.first, uris.patch_wildcard); } } -- cgit v1.2.1