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:
Riyyi
2021-09-13 00:20:38 +02:00
parent 8ce4643518
commit a217475d42
+1 -1
View File
@@ -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)