From 797ef2e2ca726bb784693a5daa47e1fc0d1b3ef7 Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Thu, 5 Jun 2014 22:07:47 +0200 Subject: [PATCH] slightly changed return values in TRI_ExtractShapedJsonVocShaper --- arangod/VocBase/voc-shaper.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/arangod/VocBase/voc-shaper.cpp b/arangod/VocBase/voc-shaper.cpp index b65e540a62..74321f5a53 100644 --- a/arangod/VocBase/voc-shaper.cpp +++ b/arangod/VocBase/voc-shaper.cpp @@ -908,13 +908,23 @@ bool TRI_ExtractShapedJsonVocShaper (TRI_shaper_t* shaper, return false; } + if (sid != 0 && sid != accessor->_resultSid) { + LOG_TRACE("expecting sid %lu for path %lu, got sid %lu", + (unsigned long) sid, + (unsigned long) pid, + (unsigned long) accessor->_resultSid); + + return false; + } + if (accessor->_resultSid == 0) { LOG_TRACE("expecting any object for path %lu, got nothing", (unsigned long) pid); - return sid == 0; + return false; } + *shape = shaper->lookupShapeId(shaper, accessor->_resultSid); if (*shape == nullptr) { @@ -923,14 +933,6 @@ bool TRI_ExtractShapedJsonVocShaper (TRI_shaper_t* shaper, (unsigned long) accessor->_resultSid); return sid == 0; - } - - if (sid != 0 && sid != accessor->_resultSid) { - LOG_TRACE("expecting sid %lu for path %lu, got sid %lu", - (unsigned long) sid, - (unsigned long) pid, - (unsigned long) accessor->_resultSid); - return false; }