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.
This commit is contained in:
+1
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user