1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

[llvm][NFC] Remove unnecessary vector creation in Annotations

This commit is contained in:
Nathan James 2020-11-14 15:55:09 +00:00
parent 7c3186ef2c
commit 0973aff95b

View File

@ -72,8 +72,10 @@ size_t Annotations::point(llvm::StringRef Name) const {
}
std::vector<size_t> Annotations::points(llvm::StringRef Name) const {
auto P = Points.lookup(Name);
return {P.begin(), P.end()};
auto I = Points.find(Name);
if (I == Points.end())
return {};
return {I->getValue().begin(), I->getValue().end()};
}
Annotations::Range Annotations::range(llvm::StringRef Name) const {
@ -85,8 +87,10 @@ Annotations::Range Annotations::range(llvm::StringRef Name) const {
std::vector<Annotations::Range>
Annotations::ranges(llvm::StringRef Name) const {
auto R = Ranges.lookup(Name);
return {R.begin(), R.end()};
auto I = Ranges.find(Name);
if (I == Ranges.end())
return {};
return {I->getValue().begin(), I->getValue().end()};
}
llvm::raw_ostream &llvm::operator<<(llvm::raw_ostream &O,