[PATCH] D47047: MC: Remove redundant substr() call
Sam Clegg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 17 18:33:41 PDT 2018
sbc100 created this revision.
Herald added subscribers: llvm-commits, aheejin.
Repository:
rL LLVM
https://reviews.llvm.org/D47047
Files:
lib/Object/MachOObjectFile.cpp
lib/Object/WasmObjectFile.cpp
Index: lib/Object/WasmObjectFile.cpp
===================================================================
--- lib/Object/WasmObjectFile.cpp
+++ lib/Object/WasmObjectFile.cpp
@@ -972,7 +972,7 @@
}
const uint8_t *WasmObjectFile::getPtr(size_t Offset) const {
- return reinterpret_cast<const uint8_t *>(getData().substr(Offset, 1).data());
+ return reinterpret_cast<const uint8_t *>(getData().data() + Offset);
}
const wasm::WasmObjectHeader &WasmObjectFile::getHeader() const {
Index: lib/Object/MachOObjectFile.cpp
===================================================================
--- lib/Object/MachOObjectFile.cpp
+++ lib/Object/MachOObjectFile.cpp
@@ -107,7 +107,7 @@
}
static const char *getPtr(const MachOObjectFile &O, size_t Offset) {
- return O.getData().substr(Offset, 1).data();
+ return O.getData().data() + Offset;
}
static MachO::nlist_base
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47047.147425.patch
Type: text/x-patch
Size: 874 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180518/08e6190b/attachment.bin>
More information about the llvm-commits
mailing list