diff options
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp | 4 | ||||
-rw-r--r-- | vespalog/src/vespa/log/log.h | 4 |
2 files changed, 4 insertions, 4 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()); diff --git a/vespalog/src/vespa/log/log.h b/vespalog/src/vespa/log/log.h index 38b16e26fc2..c69916f695a 100644 --- a/vespalog/src/vespa/log/log.h +++ b/vespalog/src/vespa/log/log.h @@ -38,13 +38,13 @@ static int log_dummmy __attribute__((unused)) = logger.setRcsId(x) #ifndef VESPA_LOG_USELOGBUFFERFORREGULARLOG #define LOG(level, ...) \ do { \ - if (logger.wants(ns_log::Logger::level)) { \ + if (__builtin_expect(logger.wants(ns_log::Logger::level), false)) { \ logger.doLog(ns_log::Logger::level, __FILE__, __LINE__, __VA_ARGS__); \ } \ } while (false) #define VLOG(level, ...) \ do { \ - if (logger.wants(level)) { \ + if (__builtin_expect(logger.wants(level), false)) { \ logger.doLog(level, __FILE__, __LINE__, __VA_ARGS__); \ } \ } while (false) |