D16425: Added new Suspend then Hibernate option

Ambareesh Balaji noreply at phabricator.kde.org
Thu Jun 6 03:37:41 BST 2019


abalaji added inline comments.

INLINE COMMENTS

> avaldes wrote in suspendsessionconfig.cpp:45
> something like this?
> 
>   : ActionConfig(parent),
>     m_suspendThenHibernateEnabled(nullptr)

Yeah exactly. So a subtle detail of C++ constructors is any data members which are not primitive (like structs class instances) get implicitly initialized using their default constructor if they don't have an entry in the initializer list. So if you do everything in the constructor body you risk double initializing stuff, which is unnecessary overhead. Of course this is not the case with primitives like pointers which are just integers behind the scenes, so what you have is okay, but just for the sake of consistency, better to make use of the initializer list

REPOSITORY
  R122 Powerdevil

BRANCH
  arcpatch-D16425_1

REVISION DETAIL
  https://phabricator.kde.org/D16425

To: avaldes, broulik, ngraham
Cc: jobauer, reverendhomer, meven, soriano, abalaji, graesslin, ngraham, plasma-devel, LeGast00n, ericadams, jraleigh, GB_2, ragreen, Pitel, ZrenBot, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190606/4497db44/attachment.html>


More information about the Plasma-devel mailing list