diff options
author | Christoph Mallon | 2011-08-07 10:05:07 +0200 |
---|---|---|
committer | Christoph Mallon | 2011-08-07 15:19:08 +0200 |
commit | e3e0a317e703fe355275a197043ec8e05005ec7b (patch) | |
tree | 6c6bd8c2d1883c88f5a02d1c0b25b641c8709c15 /audio | |
parent | a5a8833c059f28c85e392a3cd22c361d38ef95ff (diff) | |
download | scummvm-rg350-e3e0a317e703fe355275a197043ec8e05005ec7b.tar.gz scummvm-rg350-e3e0a317e703fe355275a197043ec8e05005ec7b.tar.bz2 scummvm-rg350-e3e0a317e703fe355275a197043ec8e05005ec7b.zip |
AUDIO: Simplify complicated loop condition.
- The loop is exited with break; when stream gets assigned, so stream == NULL is always true.
- When iterating using the length of an array a terminator element is unnecessary.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/audiostream.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/audio/audiostream.cpp b/audio/audiostream.cpp index 1c63ce97bf..1c5c435359 100644 --- a/audio/audiostream.cpp +++ b/audio/audiostream.cpp @@ -61,15 +61,13 @@ static const StreamFileFormat STREAM_FILEFORMATS[] = { { "MPEG Layer 3", ".mp3", makeMP3Stream }, #endif { "MPEG-4 Audio", ".m4a", makeQuickTimeStream }, - - { NULL, NULL, NULL } // Terminator }; SeekableAudioStream *SeekableAudioStream::openStreamFile(const Common::String &basename) { SeekableAudioStream *stream = NULL; Common::File *fileHandle = new Common::File(); - for (int i = 0; i < ARRAYSIZE(STREAM_FILEFORMATS)-1 && stream == NULL; ++i) { + for (int i = 0; i < ARRAYSIZE(STREAM_FILEFORMATS); ++i) { Common::String filename = basename + STREAM_FILEFORMATS[i].fileExtension; fileHandle->open(filename); if (fileHandle->isOpen()) { |