Skip to content

Commit

Permalink
ThirdParty/SmallVector: Compile fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Nov 29, 2024
1 parent b39f155 commit 83274c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common/thirdparty/SmallVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class SmallVectorTemplateCommon
/// NewSize.
bool isSafeToReferenceAfterResize(const void *Elt, size_t NewSize) {
// Past the end.
if (LLVM_LIKELY(!isReferenceToStorage(Elt)))
if (!isReferenceToStorage(Elt)) [[likely]]
return true;

// Return false if Elt will be destroyed by shrinking.
Expand Down Expand Up @@ -946,7 +946,7 @@ class SmallVectorImpl : public SmallVectorTemplateBase<T> {
}

template <typename... ArgTypes> reference emplace_back(ArgTypes &&... Args) {
if (LLVM_UNLIKELY(this->size() >= this->capacity()))
if (this->size() >= this->capacity()) [[unlikely]]
return this->growAndEmplaceBack(std::forward<ArgTypes>(Args)...);

::new ((void *)this->end()) T(std::forward<ArgTypes>(Args)...);
Expand Down

0 comments on commit 83274c7

Please sign in to comment.