Skip to content

Commit 3ad2d3d

Browse files
committed
[clang][ssaf] Optimize NestedBuildNamespace::makeQualified
1 parent 0859de9 commit 3ad2d3d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clang/include/clang/Analysis/Scalable/Model/BuildNamespace.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef LLVM_CLANG_ANALYSIS_SCALABLE_MODEL_BUILDNAMESPACE_H
1010
#define LLVM_CLANG_ANALYSIS_SCALABLE_MODEL_BUILDNAMESPACE_H
1111

12+
#include "llvm/ADT/STLExtras.h"
1213
#include "llvm/ADT/StringRef.h"
1314
#include <optional>
1415
#include <string>
@@ -62,8 +63,8 @@ class NestedBuildNamespace {
6263

6364
NestedBuildNamespace makeQualified(NestedBuildNamespace Namespace) {
6465
auto Copy = *this;
65-
for (const auto& N : Namespace.Namespaces)
66-
Copy.Namespaces.push_back(N);
66+
Copy.Namespaces.reserve(Copy.Namespaces.size() + Namespace.Namespaces.size());
67+
llvm::append_range(Copy.Namespaces, Namespace.Namespaces);
6768
return Copy;
6869
}
6970

0 commit comments

Comments
 (0)