Trivial micro optimizations (initialization lists)
ClosedPublic

Authored by jtamate on Oct 2 2018, 10:23 AM.

Details

Summary

Batch of initialization lists, according to cppcheck it is faster to do it this way.

Test Plan

make test zero fails.

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
jtamate created this revision.Oct 2 2018, 10:23 AM
Restricted Application added a project: Krita. · View Herald TranscriptOct 2 2018, 10:23 AM
jtamate requested review of this revision.Oct 2 2018, 10:23 AM
rempt added a subscriber: rempt.Oct 2 2018, 10:26 AM

This is good, but where the variable is initialized with a constant, I like it even better if the variables are initialzed where they are declared, with the {} syntax:

int bla {0}

plugins/paintops/hatching/hatching_brush.cpp
40

I prefer to have the , underneath the : -- like:

: m_settings(bla)
, separation(bla)

jtamate updated this revision to Diff 42719.Oct 2 2018, 11:29 AM

Changed comma style in initialization lists.
Using member initialization in the class declaration.
Added a constructor not detected before.

rempt accepted this revision.Oct 2 2018, 11:49 AM

Awesome!

This revision is now accepted and ready to land.Oct 2 2018, 11:49 AM
This revision was automatically updated to reflect the committed changes.