From cf0954a11ef399cbde47df99899d30fa8c7baf3a Mon Sep 17 00:00:00 2001 From: Bob Nystrom Date: Thu, 31 Oct 2024 13:46:42 -0700 Subject: [PATCH] Change firstWhereOrNull() to nonNulls.firstOrNull. (#1590) --- lib/src/front_end/piece_factory.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/front_end/piece_factory.dart b/lib/src/front_end/piece_factory.dart index e7dbed0d..46b0d4dd 100644 --- a/lib/src/front_end/piece_factory.dart +++ b/lib/src/front_end/piece_factory.dart @@ -627,8 +627,8 @@ mixin PieceFactory { // @meta // // Weird place for comment. // int f() {} - var firstToken = modifiers.firstWhereOrNull((token) => token != null) ?? - returnType.firstNonCommentToken; + var firstToken = + modifiers.nonNulls.firstOrNull ?? returnType.firstNonCommentToken; var leadingComments = pieces.takeCommentsBefore(firstToken); var returnTypePiece = pieces.build(() {