vcl/source/animate/Animation.cxx | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-)
New commits: commit 69bf59d63d4d2708a7840ff1ffad821a032c90fc Author: Adrien Ollier <adr.oll...@hotmail.fr> AuthorDate: Wed May 1 23:05:53 2019 +0200 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Fri May 3 20:36:20 2019 +0200 makes implementation of Animation::operator =(const Animation&) concise Using the logical AND, we can evaluate all the expressions from left to right into a single and condensed expression. Change-Id: I973061dcd34322c29565a478bf9b7ba757965231 Signed-off-by: Adrien Ollier <adr.oll...@hotmail.fr> Reviewed-on: https://gerrit.libreoffice.org/71651 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/vcl/source/animate/Animation.cxx b/vcl/source/animate/Animation.cxx index c4c15584b050..bb3935a41c78 100644 --- a/vcl/source/animate/Animation.cxx +++ b/vcl/source/animate/Animation.cxx @@ -86,25 +86,13 @@ Animation& Animation::operator=(const Animation& rAnimation) bool Animation::operator==(const Animation& rAnimation) const { - const size_t nCount = maList.size(); - bool bRet = false; - - if (rAnimation.maList.size() == nCount && rAnimation.maBitmapEx == maBitmapEx - && rAnimation.maGlobalSize == maGlobalSize) - { - bRet = true; - - for (size_t n = 0; n < nCount; n++) - { - if ((*maList[n]) != (*rAnimation.maList[n])) - { - bRet = false; - break; - } - } - } - - return bRet; + return maList.size() == rAnimation.maList.size() && maBitmapEx == rAnimation.maBitmapEx + && maGlobalSize == rAnimation.maGlobalSize + && std::equal(maList.begin(), maList.end(), rAnimation.maList.begin(), + [](const std::unique_ptr<AnimationBitmap>& pAnim1, + const std::unique_ptr<AnimationBitmap>& pAnim2) -> bool { + return *pAnim1 == *pAnim2; + }); } void Animation::Clear() _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits