This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 15837a6e Speed up
15837a6e is described below

commit 15837a6e026ba5ef22ff56ef57d01d23be55db90
Author: Sebb <s...@apache.org>
AuthorDate: Wed Mar 27 00:31:57 2024 +0000

    Speed up
---
 tools/download_check.rb | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/tools/download_check.rb b/tools/download_check.rb
index a36a8b2c..d5360077 100755
--- a/tools/download_check.rb
+++ b/tools/download_check.rb
@@ -395,21 +395,23 @@ def _checkDownloadPage(path, tlp, version)
 
   # Some pages are mainly a single line (e.g. Hop)
   # This make matching the appropriate match context tricky without traversing 
the DOM
-  body.scan(%r{(^.*?([^<>]+?(nightly|snapshot)[^<>]+?)).*$}i) do |m|
-    m.each do |n|
-      if n.size < 160
-        if n =~ %r{API |/api/|-docs-} # snapshot docs Datasketches (Flink)?
-          W "Found reference to NIGHTLY or SNAPSHOT docs?: #{n}"
-        else
-          # ignore trafficcontrol bugfix message
-          unless n.include? "Fixed TO log warnings when generating snapshots" 
or
-                 n.include? "Kafka Raft support for snapshots" or
-                 n.include? "zkSnapshotC" or # ZooKeepeer
-                 n.include? "/issues.apache.org/jira/browse/" # Daffodil
-            W "Found reference to NIGHTLY or SNAPSHOT builds: #{n}"
+  if body =~ %r{nightly|snapshot}i # scan can be expensive, so skip if unneeded
+    body.scan(%r{(^.*?([^<>]+?(nightly|snapshot)[^<>]+?)).*$}i) do |m|
+      m.each do |n|
+        if n.size < 160
+          if n =~ %r{API |/api/|-docs-} # snapshot docs Datasketches (Flink)?
+            W "Found reference to NIGHTLY or SNAPSHOT docs?: #{n}"
+          else
+            # ignore trafficcontrol bugfix message
+            unless n.include? "Fixed TO log warnings when generating 
snapshots" or
+                  n.include? "Kafka Raft support for snapshots" or
+                  n.include? "zkSnapshotC" or # ZooKeepeer
+                  n.include? "/issues.apache.org/jira/browse/" # Daffodil
+              W "Found reference to NIGHTLY or SNAPSHOT builds: #{n}"
+            end
           end
+          break
         end
-        break
       end
     end
   end

Reply via email to