From 9ffdbac7f017c64ddb7133268b45a8a992389591 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 3 May 2018 07:44:07 +1000 Subject: Avoid casts. --- lexlib/LexAccessor.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lexlib') diff --git a/lexlib/LexAccessor.h b/lexlib/LexAccessor.h index 87557d8c1..e1043c05f 100644 --- a/lexlib/LexAccessor.h +++ b/lexlib/LexAccessor.h @@ -157,13 +157,14 @@ public: if (validLen + (pos - startSeg + 1) >= bufferSize) Flush(); + char attr = static_cast(chAttr); if (validLen + (pos - startSeg + 1) >= bufferSize) { // Too big for buffer so send directly - pAccess->SetStyleFor(pos - startSeg + 1, static_cast(chAttr)); + pAccess->SetStyleFor(pos - startSeg + 1, attr); } else { for (Sci_PositionU i = startSeg; i <= pos; i++) { assert((startPosStyling + validLen) < Length()); - styleBuf[validLen++] = static_cast(chAttr); + styleBuf[validLen++] = attr; } } } -- cgit v1.2.3