Skip to content

Commit 0a7afb5

Browse files
committed
xrGame/sound_player.h|cpp: reference is not needed in random()
Moreover, using reference here is less optimal. Pure value is sufficient. Also removed unnecessary parenthesis
1 parent 1b5b724 commit 0a7afb5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/xrGame/sound_player.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ CSoundPlayer::CSoundCollection::~CSoundCollection()
283283
delete_data(m_sounds);
284284
}
285285

286-
const ref_sound& CSoundPlayer::CSoundCollection::random(const u32& id)
286+
const ref_sound& CSoundPlayer::CSoundCollection::random(u32 id)
287287
{
288288
VERIFY(!m_sounds.empty());
289289

@@ -307,5 +307,5 @@ const ref_sound& CSoundPlayer::CSoundCollection::random(const u32& id)
307307
} while (result == m_last_sound_id);
308308

309309
m_last_sound_id = result;
310-
return (*m_sounds[result]);
310+
return *m_sounds[result];
311311
}

src/xrGame/sound_player.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class CSoundPlayer : public CRandom32
6060
CSoundCollection(const CSoundCollectionParams& params);
6161
~CSoundCollection();
6262
IC ref_sound* add(ESoundTypes type, LPCSTR name) const;
63-
const ref_sound& random(const u32& id);
63+
const ref_sound& random(u32 id);
6464
};
6565

6666
struct CSoundSingle : public CSoundParams

0 commit comments

Comments
 (0)