From 890adfa05dcec9d004ba5a905b0862c8a65d8771 Mon Sep 17 00:00:00 2001 From: Tomasz Gucio <72562119+tgucio@users.noreply.github.com> Date: Tue, 4 Oct 2022 04:35:23 +0200 Subject: [PATCH] Remove reduntant call to _getLineBoundary (flutter/engine#36473) --- engine/src/flutter/lib/ui/text.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/engine/src/flutter/lib/ui/text.dart b/engine/src/flutter/lib/ui/text.dart index fb2627e3a12..69983ae736e 100644 --- a/engine/src/flutter/lib/ui/text.dart +++ b/engine/src/flutter/lib/ui/text.dart @@ -2865,8 +2865,7 @@ class Paragraph extends NativeFieldWrapperClass1 { final List nextBoundary = _getLineBoundary(position.offset + 1); final TextRange nextLine = TextRange(start: nextBoundary[0], end: nextBoundary[1]); - // If there is no next line, because we're at the end of the field, return - // line. + // If there is no next line, because we're at the end of the field, return line. if (!nextLine.isValid) { return line; } @@ -2876,7 +2875,6 @@ class Paragraph extends NativeFieldWrapperClass1 { // word wrap (downstream), we need to return the line for the next offset. if (position.affinity == TextAffinity.downstream && line != nextLine && position.offset == line.end && line.end == nextLine.start) { - final List nextBoundary = _getLineBoundary(position.offset + 1); return TextRange(start: nextBoundary[0], end: nextBoundary[1]); } return line;