From 3c3e271ea9fd19dd535a74b5546b27e3e82dcb81 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 17 Apr 2017 15:38:19 -0700 Subject: Use Byte/WideString iterators Change-Id: I85c8423c177fd7ecd5da90ef89419efc0f9cf44b Reviewed-on: https://pdfium-review.googlesource.com/4262 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- fxbarcode/oned/BC_OnedCodaBarWriter.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'fxbarcode/oned/BC_OnedCodaBarWriter.cpp') diff --git a/fxbarcode/oned/BC_OnedCodaBarWriter.cpp b/fxbarcode/oned/BC_OnedCodaBarWriter.cpp index 6c04cafe7b..d3706ab96d 100644 --- a/fxbarcode/oned/BC_OnedCodaBarWriter.cpp +++ b/fxbarcode/oned/BC_OnedCodaBarWriter.cpp @@ -108,18 +108,11 @@ bool CBC_OnedCodaBarWriter::FindChar(wchar_t ch, bool isContent) { } bool CBC_OnedCodaBarWriter::CheckContentValidity( const CFX_WideStringC& contents) { - wchar_t ch; - int32_t index = 0; - for (index = 0; index < contents.GetLength(); index++) { - ch = contents.GetAt(index); - if (FindChar(ch, false)) { - continue; - } else { - return false; - } - } - return true; + return std::all_of( + contents.begin(), contents.end(), + [this](const wchar_t& ch) { return this->FindChar(ch, false); }); } + CFX_WideString CBC_OnedCodaBarWriter::FilterContents( const CFX_WideStringC& contents) { CFX_WideString filtercontents; -- cgit v1.2.3