From dd18027478abbd3756f2d70e9c53bff1b70b46de Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 11 Dec 2004 04:03:12 +0000 Subject: [PATCH] optimization --- stepmania/src/RageFileBasic.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stepmania/src/RageFileBasic.cpp b/stepmania/src/RageFileBasic.cpp index 6acdb58dae..f352f50df2 100644 --- a/stepmania/src/RageFileBasic.cpp +++ b/stepmania/src/RageFileBasic.cpp @@ -20,6 +20,11 @@ RageFileObj::~RageFileObj() int RageFileObj::Seek( int iOffset ) { + /* If we're already at the requested position, short circuit and don't flush + * our buffer. */ + if( iOffset == m_iFilePos ) + return m_iFilePos; + m_bEOF = false; ResetBuf();