From 06b187c6306ab111742406ee156a42b2f68b2976 Mon Sep 17 00:00:00 2001 From: Nogringo Date: Fri, 16 Oct 2026 00:10:42 +0200 Subject: [PATCH] perf: replace lookbehind regex in _normalizeLineEndings with string replaceAll --- CHANGELOG.md | 1 + lib/src/mime_data.dart | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ccdf0517..6911fa4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ * Fix: `UsernameType.emailLocalPart` returns the local part; secure random Message-IDs; exact plus-alias matching; a working DKIM signer. * Fix: a reply that was received only partially when a connection was lost no longer corrupts the parsing of the replies after a reconnect. * Fix: non-ASCII display names are rendered as bare RFC 2047 encoded-words restricted to the characters allowed in a phrase instead of being placed inside a quoted-string; encoded words are labelled `UTF-8`. +* Fix: replace the slow lookbehind regex in `TextMimeData` line ending normalisation with plain string replacements. # 2.2.3 * Chore: Shorten package description to 60-180 characters for pub.dev score * Docs: Add example file (example/example.dart) diff --git a/lib/src/mime_data.dart b/lib/src/mime_data.dart index 8fff82c5..ca8d5918 100644 --- a/lib/src/mime_data.dart +++ b/lib/src/mime_data.dart @@ -133,7 +133,7 @@ class TextMimeData extends MimeData { /// Normalizes bare LF to CRLF for RFC 5322 compliance. static String _normalizeLineEndings(String text) => - text.replaceAll(RegExp(r'(?