From c6ac0e5ca74a719a6990f6bba5002883900ad85c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 17 Nov 2016 16:22:22 -0800 Subject: [PATCH] [coff] Eliminate another peek() function --- toolsrc/src/coff_file_reader.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/toolsrc/src/coff_file_reader.cpp b/toolsrc/src/coff_file_reader.cpp index 9ea79bf99a..6a2a571598 100644 --- a/toolsrc/src/coff_file_reader.cpp +++ b/toolsrc/src/coff_file_reader.cpp @@ -75,14 +75,6 @@ namespace vcpkg { namespace COFFFileReader return ret; } - static coff_file_header peek(fstream& fs) - { - auto original_pos = fs.tellg().seekpos(); - coff_file_header ret = read(fs); - fs.seekg(original_pos); - return ret; - } - MachineType machineType() const { static const size_t MACHINE_TYPE_OFFSET = 0; @@ -272,7 +264,7 @@ namespace vcpkg { namespace COFFFileReader { const uint16_t first_two_bytes = peek_value_from_stream(fs); const bool isImportHeader = getMachineType(first_two_bytes) == MachineType::UNKNOWN; - const MachineType machine = isImportHeader ? import_header::read(fs).machineType() : coff_file_header::peek(fs).machineType(); + const MachineType machine = isImportHeader ? import_header::read(fs).machineType() : coff_file_header::read(fs).machineType(); machine_types.insert(machine); } marker.advance_by(archive_member_header::HEADER_SIZE + header.member_size());