diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-02-28 10:11:12 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-02-28 10:11:12 +0000 |
commit | 4f6ac16292f5435cd00782757e6794f2bf6b64f5 (patch) | |
tree | bbba5b9d8e7f5e816bce01feb0dd5c3c62365821 /llvm/lib/DebugInfo | |
parent | b759340fc82a209e36455af5e9dc4e6c0d9e7dfb (diff) | |
download | bcm5719-llvm-4f6ac16292f5435cd00782757e6794f2bf6b64f5.tar.gz bcm5719-llvm-4f6ac16292f5435cd00782757e6794f2bf6b64f5.zip |
Replace std::copy with a back inserter with vector append where feasible
All of the cases were just appending from random access iterators to a
vector. Using insert/append can grow the vector to the perfect size
directly and moves the growing out of the loop. No intended functionalty
change.
llvm-svn: 230845
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp index fdb6dd26b11..cd6fbefd05d 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp @@ -67,8 +67,7 @@ void DWARFDebugLoc::parse(DataExtractor data, unsigned AddressSize) { // A single location description describing the location of the object... StringRef str = data.getData().substr(Offset, Bytes); Offset += Bytes; - E.Loc.reserve(str.size()); - std::copy(str.begin(), str.end(), std::back_inserter(E.Loc)); + E.Loc.append(str.begin(), str.end()); Loc.Entries.push_back(std::move(E)); } } |