Skip to content

Commit a81fb84

Browse files
committedMay 30, 2018
MC: Remove redundant substr() call
Differential Revision: https://reviews.llvm.org/D47047 llvm-svn: 333496
1 parent e1076e5 commit a81fb84

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎llvm/lib/Object/MachOObjectFile.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ getSectionPtr(const MachOObjectFile &O, MachOObjectFile::LoadCommandInfo L,
107107
}
108108

109109
static const char *getPtr(const MachOObjectFile &O, size_t Offset) {
110-
return O.getData().substr(Offset, 1).data();
110+
return O.getData().data() + Offset;
111111
}
112112

113113
static MachO::nlist_base

‎llvm/lib/Object/WasmObjectFile.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ Error WasmObjectFile::parseDataSection(ReadContext &Ctx) {
995995
}
996996

997997
const uint8_t *WasmObjectFile::getPtr(size_t Offset) const {
998-
return reinterpret_cast<const uint8_t *>(getData().substr(Offset, 1).data());
998+
return reinterpret_cast<const uint8_t *>(getData().data() + Offset);
999999
}
10001000

10011001
const wasm::WasmObjectHeader &WasmObjectFile::getHeader() const {

0 commit comments

Comments
 (0)
Please sign in to comment.