From 9ae6631a116ed65bd890cbcc9d2d1fb0947f8cb2 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 10 Sep 2023 19:17:15 +0300 Subject: [Header-description] More optimizations by replacing match with index --- awk-edits/Header-description.awk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'awk-edits/Header-description.awk') diff --git a/awk-edits/Header-description.awk b/awk-edits/Header-description.awk index 645a1ac..cdadf4d 100644 --- a/awk-edits/Header-description.awk +++ b/awk-edits/Header-description.awk @@ -28,17 +28,17 @@ BEGIN { # Loop over the whole file, extract all text in first couple of paragraphs, # store it in desc (but no more than 200 characters will be saved) while(getline < ARGV[1]) { - if (match($0, //)) + if (index($0, "

")) parstar = 4; - if (match($0, /<\/p>$/)) + if (index($0, "

")) parends = 3; if (parcont || parstar == 4) { if (appToDesc($0)) break; - parcont = RSTART == 0; + parcont = parends == 0; parstar = 1; parends = 0; } -- cgit v1.3.1-26-gb76a