Skip to content

Commit

Permalink
remove unprotected optional deref Errata::severity (#11996)
Browse files Browse the repository at this point in the history
(cherry picked from commit 775cf94)
  • Loading branch information
cmcfarlen authored and Chris McFarlen committed Jan 28, 2025
1 parent 33da84b commit 2121db5
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions lib/swoc/include/swoc/Errata.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,9 @@ class Errata {
/// 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);
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 2121db5

Please sign in to comment.