From 24c99e005a617d3a1715657c65f9928c087192d7 Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 25 Jan 2023 15:14:27 -0500 Subject: [PATCH] add a sounds.c comment in two places --- src/sounds.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/sounds.c b/src/sounds.c index e6845f267..2c68a78f8 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1556,6 +1556,10 @@ play_sound_for_message(const char* msg) { audio_mapping *snd; + /* we do this check here first, in order to completely + * avoid doing the regex search when there won't be a + * sound anyway, despite a match. + */ if (soundprocs.sound_play_usersound) { snd = sound_matches_message(msg); if (snd) { @@ -1569,6 +1573,10 @@ maybe_play_sound(const char* msg) { audio_mapping *snd; + /* we do this check here first, in order to completely + * avoid doing the regex search when there won't be a + * sound anyway, despite a match. + */ if (soundprocs.sound_play_usersound) { snd = sound_matches_message(msg); if (snd) { -- 2.50.1