mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix various performance issues reported by cppcheck (#5628)
* Also remove 1 non declared but defined functions
This commit is contained in:
parent
de5ecc9fa3
commit
370354cc87
8 changed files with 57 additions and 75 deletions
|
@ -930,7 +930,7 @@ void Peer::DecUseCount()
|
|||
delete this;
|
||||
}
|
||||
|
||||
void Peer::RTTStatistics(float rtt, std::string profiler_id,
|
||||
void Peer::RTTStatistics(float rtt, const std::string &profiler_id,
|
||||
unsigned int num_samples) {
|
||||
|
||||
if (m_last_rtt > 0) {
|
||||
|
@ -969,8 +969,7 @@ void Peer::RTTStatistics(float rtt, std::string profiler_id,
|
|||
m_rtt.jitter_avg = m_rtt.jitter_avg * (num_samples/(num_samples-1)) +
|
||||
jitter * (1/num_samples);
|
||||
|
||||
if (profiler_id != "")
|
||||
{
|
||||
if (profiler_id != "") {
|
||||
g_profiler->graphAdd(profiler_id + "_rtt", rtt);
|
||||
g_profiler->graphAdd(profiler_id + "_jitter", jitter);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue