D25022: Add some const &

Albert Astals Cid <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
aacid added a comment.


  In D25022#556505 <https://phabricator.kde.org/D25022#556505>, @zzag wrote:
  
  > > For shared pointers instead of adding const & we move them into the destination variable saving some cpu usage but at the same time making clear the pointer is being stored by not being const &
  >
  > It's worth to point out that smart pointers in Qt are not movable. So we'll still be copying shared pointers.
  
  
  What do you mean they are not movable?
  
    https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qshareddata.h?h=5.13#n222
  
  has the move operator for QExplicitlySharedDataPointer which is what a KSharedConfigPtr is. It doesn't involve ref counting like the copy constructor in
  
    https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/tools/qshareddata.h?h=5.13#n185

REPOSITORY
  R108 KWin

BRANCH
  arcpatch-D25022

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

To: aacid, zzag
Cc: zzag, kwin, LeGast00n, The-Feren-OS-Dev, sbergeron, jraleigh, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.