From c35fb7104b850806fcc9b9949a554416bc604404 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 31 Mar 2022 17:55:27 -0700 Subject: [PATCH] clang-tidy: use any_of Signed-off-by: Rosen Penev --- src/jpgimage.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/jpgimage.cpp b/src/jpgimage.cpp index 13e59471..01b22f33 100644 --- a/src/jpgimage.cpp +++ b/src/jpgimage.cpp @@ -38,11 +38,7 @@ static inline bool inRange2(int value, int lo1, int hi1, int lo2, int hi2) { bool Photoshop::isIrb(const byte* pPsData, size_t sizePsData) { if (sizePsData < 4) return false; - for (auto&& i : irbId_) { - if (memcmp(pPsData, i, 4) == 0) - return true; - } - return false; + return std::any_of(irbId_.begin(), irbId_.end(), [pPsData](auto id) { return memcmp(pPsData, id, 4) == 0; }); } bool Photoshop::valid(const byte* pPsData, size_t sizePsData) {