From 88d5fa948bb9e0fb4b68e177deeca8237f3c6d7e Mon Sep 17 00:00:00 2001 From: chillbram Date: Tue, 3 Dec 2024 18:05:15 +0100 Subject: [PATCH 1/2] Remove redundant function call --- src/Extension/Strikethrough/StrikethroughDelimiterProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Extension/Strikethrough/StrikethroughDelimiterProcessor.php b/src/Extension/Strikethrough/StrikethroughDelimiterProcessor.php index af0fdb17c7..f5f8c0bb69 100644 --- a/src/Extension/Strikethrough/StrikethroughDelimiterProcessor.php +++ b/src/Extension/Strikethrough/StrikethroughDelimiterProcessor.php @@ -44,7 +44,7 @@ public function getDelimiterUse(DelimiterInterface $opener, DelimiterInterface $ return 0; } - return \min($opener->getLength(), $closer->getLength()); + return $opener->getLength(); } public function process(AbstractStringContainer $opener, AbstractStringContainer $closer, int $delimiterUse): void From 29e61319002bd20457011af47ee0d1bd4b7c6e69 Mon Sep 17 00:00:00 2001 From: chillbram Date: Wed, 4 Dec 2024 14:12:51 +0100 Subject: [PATCH 2/2] Add explainer comment --- src/Extension/Strikethrough/StrikethroughDelimiterProcessor.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Extension/Strikethrough/StrikethroughDelimiterProcessor.php b/src/Extension/Strikethrough/StrikethroughDelimiterProcessor.php index f5f8c0bb69..978e75a43f 100644 --- a/src/Extension/Strikethrough/StrikethroughDelimiterProcessor.php +++ b/src/Extension/Strikethrough/StrikethroughDelimiterProcessor.php @@ -44,6 +44,7 @@ public function getDelimiterUse(DelimiterInterface $opener, DelimiterInterface $ return 0; } + // $opener and $closer are the same length so we just return one of them return $opener->getLength(); }