From d4862a88ec4fba32908dba8c1a32d1467513e5ca Mon Sep 17 00:00:00 2001 From: Bowon Ryu Date: Thu, 12 Jan 2023 15:04:34 +0900 Subject: [PATCH] remove unreachable code in text geometry lineIndex can not be -1 Change-Id: I31e9c4a554e93550bbd6e63b0daca3b199556be3 Signed-off-by: Bowon Ryu --- dali-toolkit/internal/text/text-geometry.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/dali-toolkit/internal/text/text-geometry.cpp b/dali-toolkit/internal/text/text-geometry.cpp index 359d992eee..3635d0ce85 100644 --- a/dali-toolkit/internal/text/text-geometry.cpp +++ b/dali-toolkit/internal/text/text-geometry.cpp @@ -428,7 +428,7 @@ int GetCharIndexAtPosition(ModelPtr textModel, float visualX, float visualY) const Vector& lines = visualModel->mLines; float lineTop = 0.f; - int lineIndex = -1; + int lineIndex = 0; int high = totalNumberOfLines; int low = -1; int guess; @@ -474,12 +474,6 @@ int GetCharIndexAtPosition(ModelPtr textModel, float visualX, float visualY) } } - // Check if a line is not found; return -1. - if(lineIndex == -1) - { - return -1; - } - // Start searching for the visualX const LineRun& line = *(visualModel->mLines.Begin() + lineIndex); -- 2.34.1