From 53164e9b1f33c8d094ab17000abec669a91e89ee Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 6 Jun 2004 23:17:44 +0000 Subject: [PATCH] remove unneeded seek --- stepmania/src/CryptHelpers.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/stepmania/src/CryptHelpers.cpp b/stepmania/src/CryptHelpers.cpp index 4e4685ef33..096e505688 100644 --- a/stepmania/src/CryptHelpers.cpp +++ b/stepmania/src/CryptHelpers.cpp @@ -78,7 +78,7 @@ unsigned int RageFileStore::CopyRangeTo2(BufferedTransformation &target, unsigne byte result; m_file.Read( &result, 1 ); m_file.Seek( current ); - if (m_file.AtEOF()) // GCC workaround: 2.95.2 doesn't have char_traits::eof() + if (m_file.AtEOF()) { return 0; } @@ -91,12 +91,11 @@ unsigned int RageFileStore::CopyRangeTo2(BufferedTransformation &target, unsigne } // TODO: figure out what happens on cin + // (What does that mean?) int current = m_file.Tell(); - int endPosition = m_file.GetFileSize(); - m_file.Seek( endPosition ); int newPosition = current + (streamoff)begin; - if (newPosition >= endPosition) + if( newPosition >= m_file.GetFileSize() ) { m_file.Seek(current); return 0; // don't try to seek beyond the end of file