From 754c696dc2c755d3bcaca96246ab81381edc0ad1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 23 Sep 2018 21:38:03 +0200 Subject: Parse overridden properties with a single PUT --- src/Parser.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Parser.cpp b/src/Parser.cpp index c9736a71..0288497e 100644 --- a/src/Parser.cpp +++ b/src/Parser.cpp @@ -503,13 +503,19 @@ parse_properties(ingen::World* world, { Properties properties = get_properties(world, model, subject, ctx); - target->put(uri, properties, ctx); - - // Set passed properties last to override any loaded values + // Replace any properties given in `data` if (data) { - target->put(uri, data.get(), ctx); + for (const auto& prop : *data) { + properties.erase(prop.first); + } + + for (const auto& prop : *data) { + properties.emplace(prop); + } } + target->put(uri, properties, ctx); + return true; } -- cgit v1.2.1