From 35d82b7847eef886dfe546ca54835e481ad4386a Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Sun, 26 Nov 2023 22:01:29 -0700 Subject: [PATCH] Simplify implementation of `sf::InputSoundFile::close` --- src/SFML/Audio/InputSoundFile.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/SFML/Audio/InputSoundFile.cpp b/src/SFML/Audio/InputSoundFile.cpp index f639d4f0e..5a13ca8b1 100644 --- a/src/SFML/Audio/InputSoundFile.cpp +++ b/src/SFML/Audio/InputSoundFile.cpp @@ -255,17 +255,7 @@ std::uint64_t InputSoundFile::read(std::int16_t* samples, std::uint64_t maxCount //////////////////////////////////////////////////////////// void InputSoundFile::close() { - // Destroy the reader - m_reader.reset(); - - // Destroy the stream if we own it - m_stream.reset(); - - // Reset the sound file attributes - m_sampleOffset = 0; - m_sampleCount = 0; - m_channelCount = 0; - m_sampleRate = 0; + *this = {}; } } // namespace sf