From c45e41950fc2969b24d41223605a661195636a36 Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Mon, 9 Apr 2018 00:05:12 +0100 Subject: [PATCH] Use standard library over while loop --- Parsedown.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Parsedown.php b/Parsedown.php index 1dc4f0e..0057566 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -199,12 +199,7 @@ class Parsedown } } - $indent = 0; - - while (isset($line[$indent]) and $line[$indent] === ' ') - { - $indent ++; - } + $indent = strspn($line, ' '); $text = $indent > 0 ? substr($line, $indent) : $line;