Skip to content

Prefer QRegion::operator+=

Vlad Zahorodnii requested to merge work/zzag/prefer-qregion-plus-equal into master
`QRegion::operator|=` has some optimizations but it basically boils
down to

  QRegion result(*this);
  result.detach(); // it will make a copy because this is shared
  result.d->append(rect);
  return result;

On the other hand, `QRegion::operator+=` tries to add the new rect
in-place.
Edited by Vlad Zahorodnii

Merge request reports

Loading