Browse Source

Util: Avoid assigning variable by passing to the initialization list

When an object of a class is created, the constructors of all member
variables are called consecutively in the order the variables are
declared, even if you don't explicitly write them to the initialization
list.
master
Riyyi 3 years ago
parent
commit
a217475d42
  1. 2
      src/util/timer.cpp

2
src/util/timer.cpp

@ -7,8 +7,8 @@
namespace Util {
Timer::Timer()
: m_start(std::chrono::high_resolution_clock::now())
{
m_start = std::chrono::high_resolution_clock::now();
}
Timer Timer::operator-(const Timer& timer)

Loading…
Cancel
Save