From a81fb84811ae07dc9827ffa370354e801e337fa4 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Wed, 30 May 2018 03:37:26 +0000 Subject: MC: Remove redundant substr() call Differential Revision: https://reviews.llvm.org/D47047 llvm-svn: 333496 --- llvm/lib/Object/WasmObjectFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Object/WasmObjectFile.cpp') diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp index f822d07a253..2f91a973dda 100644 --- a/llvm/lib/Object/WasmObjectFile.cpp +++ b/llvm/lib/Object/WasmObjectFile.cpp @@ -995,7 +995,7 @@ Error WasmObjectFile::parseDataSection(ReadContext &Ctx) { } const uint8_t *WasmObjectFile::getPtr(size_t Offset) const { - return reinterpret_cast(getData().substr(Offset, 1).data()); + return reinterpret_cast(getData().data() + Offset); } const wasm::WasmObjectHeader &WasmObjectFile::getHeader() const { -- cgit v1.2.3