summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp87
-rw-r--r--staging_vespalib/src/vespa/vespalib/objects/object2slime.cpp11
2 files changed, 49 insertions, 49 deletions
diff --git a/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp b/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp
index 0d34b41d5c7..108b7b9d20d 100644
--- a/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp
+++ b/searchlib/src/tests/queryeval/blueprint/blueprint_test.cpp
@@ -703,50 +703,49 @@ getExpectedBlueprint()
vespalib::string
getExpectedSlimeBlueprint() {
return "{"
- " '(anonymous namespace)::MyOr': {"
- " isTermLike: true,"
- " fields: {"
- " '[type]': 'FieldList',"
- " '[0]': {"
- " '[type]': 'Field',"
- " fieldId: 5,"
- " handle: 7,"
- " isFilter: false"
- " }"
- " },"
- " estimate: {"
- " '[type]': 'HitEstimate',"
- " empty: false,"
- " estHits: 9,"
- " tree_size: 2,"
- " allow_termwise_eval: 0"
- " },"
- " sourceId: 4294967295,"
- " docid_limit: 0,"
- " children: {"
- " '[type]': 'std::vector',"
- " '[0]': {"
- " isTermLike: true,"
- " fields: {"
- " '[type]': 'FieldList',"
- " '[0]': {"
- " '[type]': 'Field',"
- " fieldId: 5,"
- " handle: 7,"
- " isFilter: false"
- " }"
- " },"
- " '[type]': '(anonymous namespace)::MyTerm',"
- " estimate: {"
- " '[type]': 'HitEstimate',"
- " empty: false,"
- " estHits: 9,"
- " tree_size: 1,"
- " allow_termwise_eval: 1"
- " },"
- " sourceId: 4294967295,"
- " docid_limit: 0"
- " }"
+ " '[type]': '(anonymous namespace)::MyOr',"
+ " isTermLike: true,"
+ " fields: {"
+ " '[type]': 'FieldList',"
+ " '[0]': {"
+ " '[type]': 'Field',"
+ " fieldId: 5,"
+ " handle: 7,"
+ " isFilter: false"
+ " }"
+ " },"
+ " estimate: {"
+ " '[type]': 'HitEstimate',"
+ " empty: false,"
+ " estHits: 9,"
+ " tree_size: 2,"
+ " allow_termwise_eval: 0"
+ " },"
+ " sourceId: 4294967295,"
+ " docid_limit: 0,"
+ " children: {"
+ " '[type]': 'std::vector',"
+ " '[0]': {"
+ " isTermLike: true,"
+ " fields: {"
+ " '[type]': 'FieldList',"
+ " '[0]': {"
+ " '[type]': 'Field',"
+ " fieldId: 5,"
+ " handle: 7,"
+ " isFilter: false"
+ " }"
+ " },"
+ " '[type]': '(anonymous namespace)::MyTerm',"
+ " estimate: {"
+ " '[type]': 'HitEstimate',"
+ " empty: false,"
+ " estHits: 9,"
+ " tree_size: 1,"
+ " allow_termwise_eval: 1"
+ " },"
+ " sourceId: 4294967295,"
+ " docid_limit: 0"
" }"
" }"
"}";
diff --git a/staging_vespalib/src/vespa/vespalib/objects/object2slime.cpp b/staging_vespalib/src/vespa/vespalib/objects/object2slime.cpp
index 184ae768908..562f332fb89 100644
--- a/staging_vespalib/src/vespa/vespalib/objects/object2slime.cpp
+++ b/staging_vespalib/src/vespa/vespalib/objects/object2slime.cpp
@@ -19,11 +19,10 @@ Object2Slime::~Object2Slime() = default;
void
Object2Slime::openStruct(const vespalib::string &name, const vespalib::string &type)
{
- _stack.push_back(_cursor);
-
if (name.empty()) {
- _cursor = _cursor.get().setObject(type);
+ _cursor.get().setString("[type]", type);
} else {
+ _stack.push_back(_cursor);
_cursor = _cursor.get().setObject(name);
_cursor.get().setString("[type]", type);
}
@@ -32,8 +31,10 @@ Object2Slime::openStruct(const vespalib::string &name, const vespalib::string &t
void
Object2Slime::closeStruct()
{
- _cursor = _stack.back();
- _stack.pop_back();
+ if ( ! _stack.empty()) {
+ _cursor = _stack.back();
+ _stack.pop_back();
+ }
}
void