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

cmcfarlen pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 2121db5b90e4099841808f2f0540933227931c95
Author: Chris McFarlen <[email protected]>
AuthorDate: Tue Jan 28 11:22:43 2025 -0600

    remove unprotected optional deref Errata::severity (#11996)
    
    (cherry picked from commit 775cf94f257844fb394e427989ae3c92e3c1308c)
---
 lib/swoc/include/swoc/Errata.h | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/lib/swoc/include/swoc/Errata.h b/lib/swoc/include/swoc/Errata.h
index fff9e17db1..05f3652472 100644
--- a/lib/swoc/include/swoc/Errata.h
+++ b/lib/swoc/include/swoc/Errata.h
@@ -115,14 +115,9 @@ public:
     /// Check if @a this has a @c Severity.
     bool has_severity() const;
 
-    /// Retrieve the local severity.
-    /// @return The local severity.
-    /// @note The behavior is undefined if there is no local severity.
-    Severity severity() const;
-
     /// Retrieve the local severity.
     /// @return The local severity or @a default_severity if none is set.
-    Severity severity(Severity default_severity) const;
+    Severity severity(Severity default_severity = DEFAULT_SEVERITY) const;
 
     /// Set the @a severity of @a this.
     self_type &assign(Severity severity);
@@ -998,10 +993,6 @@ Errata::Annotation::has_severity() const {
   return _severity.has_value();
 }
 inline auto
-Errata::Annotation::severity() const -> Severity {
-  return *_severity;
-}
-inline auto
 Errata::Annotation::severity(Errata::Severity default_severity) const -> 
Severity {
   return _severity.value_or(default_severity);
 }

Reply via email to