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/datamatrix/BC_Base256Encoder.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'fxbarcode/datamatrix/BC_Base256Encoder.cpp') diff --git a/fxbarcode/datamatrix/BC_Base256Encoder.cpp b/fxbarcode/datamatrix/BC_Base256Encoder.cpp index 1b8db85bdd..dd49c8e0f5 100644 --- a/fxbarcode/datamatrix/BC_Base256Encoder.cpp +++ b/fxbarcode/datamatrix/BC_Base256Encoder.cpp @@ -70,9 +70,8 @@ void CBC_Base256Encoder::Encode(CBC_EncoderContext& context, int32_t& e) { return; } } - for (int32_t i = 0, c = buffer.GetLength(); i < c; i++) { - context.writeCodeword( - randomize255State(buffer.GetAt(i), context.getCodewordCount() + 1)); + for (const auto& c : buffer) { + context.writeCodeword(randomize255State(c, context.getCodewordCount() + 1)); } } wchar_t CBC_Base256Encoder::randomize255State(wchar_t ch, -- cgit v1.2.3