Choose executorId the same way both places.
@@ -86,6 +86,11 @@ AttributeWriter::WriteContext::buildFieldPaths(const DocumentType &docType)
namespace {
+vespalib::stringref
+getPrefix(vespalib::stringref name ) {
+ return name.substr(0, name.find('.'));
+}
+
void
ensureLidSpace(SerialNum serialNum, DocumentIdT lid, AttributeVector &attr)
{
@@ -232,7 +237,7 @@ public:
FieldContext::FieldContext(ISequencedTaskExecutor &writer, AttributeVector *attr)
: _name(attr->getName()),
- _executorId(writer.getExecutorId(_name)),
+ _executorId(writer.getExecutorId(getPrefix(_name))),
_attr(attr)
{
}
@@ -480,8 +485,7 @@ AttributeWriter::AttributeWriter(const proton::IAttributeManager::SP &mgr)
setupWriteContexts();
for (auto attr : getWritableAttributes()) {
vespalib::stringref name = attr->getName();
- vespalib::stringref prefix = name.substr(0, name.find('.'));
- _attrMap[attr->getName()] = AttrWithId(attr, _attributeFieldWriter.getExecutorId(prefix));
+ _attrMap[name] = AttrWithId(attr, _attributeFieldWriter.getExecutorId(getPrefix(name)));
}
}
