From 154ca4f2cf071615411776957e03dc627d4b19ff Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 5 Aug 2003 00:53:25 +0000 Subject: simplified code a bit svn-id: r9474 --- sound/audiostream.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound/audiostream.cpp') diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp index 684673d6c1..7a1a537ebb 100644 --- a/sound/audiostream.cpp +++ b/sound/audiostream.cpp @@ -146,8 +146,8 @@ template int WrappedMemoryStream::readBuffer(int16 *buffer, int numSamples) { int samples = 0; #if 1 - for (int i = (_pos > _end) ? 0 : 1; i < 2 && samples < numSamples && !eosIntern(); i++) { - const byte *endMarker = (i == 0) ? _bufferEnd : _end; + while (samples < numSamples && !eosIntern()) { + const byte *endMarker = (_pos > _end) ? _bufferEnd : _end; const int len = MIN(numSamples, (endMarker - _pos) / (is16Bit ? 2 : 1)); while (samples < len) { -- cgit v1.2.3