From 193e6ca5e48ee99e620f0e7546f1407ba1a20323 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 14 Mar 2017 15:53:36 -0700 Subject: Add IndexInBounds() convenience routine. Avoid writing |Type| in CollectionSize() so that index type can change without rewriting conditions. Change-Id: I40c94ca39148b379908760ba9b861114b88af7bb Reviewed-on: https://pdfium-review.googlesource.com/3056 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- xfa/fgas/layout/cfx_breakline.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xfa/fgas/layout/cfx_breakline.cpp') diff --git a/xfa/fgas/layout/cfx_breakline.cpp b/xfa/fgas/layout/cfx_breakline.cpp index 65860e4013..562f984ffe 100644 --- a/xfa/fgas/layout/cfx_breakline.cpp +++ b/xfa/fgas/layout/cfx_breakline.cpp @@ -17,12 +17,12 @@ int32_t CFX_BreakLine::CountChars() const { } CFX_Char* CFX_BreakLine::GetChar(int32_t index) { - ASSERT(index >= 0 && index < pdfium::CollectionSize(m_LineChars)); + ASSERT(pdfium::IndexInBounds(m_LineChars, index)); return &m_LineChars[index]; } const CFX_Char* CFX_BreakLine::GetChar(int32_t index) const { - ASSERT(index >= 0 && index < pdfium::CollectionSize(m_LineChars)); + ASSERT(pdfium::IndexInBounds(m_LineChars, index)); return &m_LineChars[index]; } -- cgit v1.2.3