summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-11-06 18:49:35 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-11-07 23:20:36 +0000
commit483ef993f06040f76b133ac857095e75c58e44bc (patch)
tree4d1b4bf741aaf388b0b7fe212c184b3ae87c6803 /searchcore
parent81f33dd36a90bcef7be8a88021a820526b093c06 (diff)
Use builtin_expect to advise on most likely branch
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp
index 2b859c17931..f129afc6347 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp
@@ -681,13 +681,13 @@ AttributeWriter::update(SerialNum serialNum, const DocumentUpdate &upd, Document
auto found = _attrMap.find(fupd.getField().getName());
AttributeVector * attrp = (found != _attrMap.end()) ? found->second.first : nullptr;
onUpdate.onUpdateField(fupd.getField().getName(), attrp);
- if (attrp == nullptr) {
+ if (__builtin_expect(attrp == nullptr, false)) {
LOG(spam, "Failed to find attribute vector %s", fupd.getField().getName().data());
continue;
}
// TODO: Check if we must use > due to multiple entries for same
// document and attribute.
- if (attrp->getStatus().getLastSyncToken() >= serialNum)
+ if (__builtin_expect(attrp->getStatus().getLastSyncToken() >= serialNum, false))
continue;
args[found->second.second.getId()]->_updates.emplace_back(attrp, &fupd);
LOG(debug, "About to apply update for docId %u in attribute vector '%s'.", lid, attrp->getName().c_str());