dfaure accepted this revision.
dfaure added inline comments.
This revision is now accepted and ready to land.

INLINE COMMENTS

> Polkit1Backend.cpp:203
>  {
> -    Q_FOREACH (const QString &action, m_cachedResults.keys()) {
> +    const auto listKeys = m_cachedResults.keys();
> +    for (const QString &action : listKeys) {

(pre-existing) bad, very slow, creates a temp container just to iterate.

  for (auto it = m_cachedResults.begin(); it != m_cachedResults.end(); ++it) {
      const QString action = it.key();
      if (it.value() != ....) {
          *it = ....;
           ...
      }
  }

REPOSITORY
  R283 KAuth

BRANCH
  compile_without_foreach (branched from master)

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

To: mlaurent, dfaure
Cc: kde-frameworks-devel, michaelh, ngraham, bruns

Reply via email to