lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 8882ef7 07/12: Use contains() for the lmi URL


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 8882ef7 07/12: Use contains() for the lmi URL check
Date: Mon, 28 Jun 2021 18:44:28 -0400 (EDT)

branch: master
commit 8882ef78686f6075db878a8ff7a5944275281ac9
Author: Vadim Zeitlin <vadim@tt-solutions.com>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Use contains() for the lmi URL check
    
    This is simpler, more correct (because periods in the regex would need
    to be escaped, making it less readable, to really match just this URL)
    and much faster (by a factor of ≈50).
---
 test_coding_rules.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/test_coding_rules.cpp b/test_coding_rules.cpp
index 4d345df..7d1e8f6 100644
--- a/test_coding_rules.cpp
+++ b/test_coding_rules.cpp
@@ -910,8 +910,10 @@ void check_preamble(file const& f)
         return;
         }
 
-    static std::string const url("https://savannah.nongnu.org/projects/lmi";);
-    require(f, url, "lacks lmi URL.");
+    if(!contains(f.data(), "https://savannah.nongnu.org/projects/lmi";))
+        {
+        complain(f, "lacks lmi URL.");
+        }
 }
 
 /// Deem a reserved name permissible or not.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]