changeset 1625:4a2c63ae8f99

minor optimization
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 06 Nov 2020 17:36:35 +0100
parents 59f95b9ea858
children 58abe9e13ee3
files OrthancStone/Sources/Scene2D/Internals/CairoTextRenderer.cpp
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancStone/Sources/Scene2D/Internals/CairoTextRenderer.cpp	Fri Nov 06 17:30:36 2020 +0100
+++ b/OrthancStone/Sources/Scene2D/Internals/CairoTextRenderer.cpp	Fri Nov 06 17:36:35 2020 +0100
@@ -48,10 +48,11 @@
           throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
         }
         
+        const unsigned int height = source->GetHeight();
         const unsigned int width = source->GetWidth();
         const Color& color = layer.GetColor();
-
-        for (unsigned int y = 0; y < source->GetHeight(); y++)
+        
+        for (unsigned int y = 0; y < height; y++)
         {
           const uint8_t* p = reinterpret_cast<const uint8_t*>(source->GetConstRow(y));
           uint8_t* q = reinterpret_cast<uint8_t*>(accessor.GetRow(y));