From 5ff1c39e02d08265a631a2cf7141e3465022972a Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 8 Nov 2016 20:34:55 +0100 Subject: [PATCH] Obj-Parser: Fix performance issue. --- code/IOStreamBuffer.h | 3 ++- test/unit/utTypes.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/code/IOStreamBuffer.h b/code/IOStreamBuffer.h index 9d87942df..fe7b2a50a 100644 --- a/code/IOStreamBuffer.h +++ b/code/IOStreamBuffer.h @@ -230,7 +230,7 @@ template inline bool IOStreamBuffer::getNextLine( std::vector &buffer ) { buffer.resize( m_cacheSize ); - ::memset( &buffer[ 0 ], '\n', m_cacheSize ); + //::memset( &buffer[ 0 ], '\n', m_cacheSize ); if ( m_cachePos == m_cacheSize || 0 == m_filePos ) { if ( !readNextBlock() ) { @@ -248,6 +248,7 @@ bool IOStreamBuffer::getNextLine( std::vector &buffer ) { } } } + buffer[ i ] = '\n'; m_cachePos++; return true; diff --git a/test/unit/utTypes.cpp b/test/unit/utTypes.cpp index 47c39f989..875f66240 100644 --- a/test/unit/utTypes.cpp +++ b/test/unit/utTypes.cpp @@ -43,6 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include using namespace Assimp; + class utTypes : public ::testing::Test { // empty };