This is an automated email from the ASF dual-hosted git repository. bneradt pushed a commit to branch errata-note-severity in repository https://gitbox.apache.org/repos/asf/trafficserver-libswoc.git
commit 2c24e22223576540b7da5aebd231976c0aa0da67 Author: Alan M. Carroll <[email protected]> AuthorDate: Mon Jan 10 15:52:31 2022 -0600 Tweaks. --- code/include/swoc/Errata.h | 2 -- code/src/Errata.cc | 7 ++++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/code/include/swoc/Errata.h b/code/include/swoc/Errata.h index a1874e1..1076096 100644 --- a/code/include/swoc/Errata.h +++ b/code/include/swoc/Errata.h @@ -185,8 +185,6 @@ protected: Severity _severity{Errata::DEFAULT_SEVERITY}; ///< Severity. code_type _code{Errata::DEFAULT_CODE}; ///< Message code / ID - unsigned _level{0}; ///< Nesting level. - std::atomic<int> _ref_count{0}; ///< Reference count. Container _notes; ///< The message stack. swoc::MemArena _arena; ///< Annotation text storage. }; diff --git a/code/src/Errata.cc b/code/src/Errata.cc index 2b7b0da..b93e328 100644 --- a/code/src/Errata.cc +++ b/code/src/Errata.cc @@ -95,7 +95,7 @@ Errata::note_s(std::optional<Severity> severity, std::string_view text) { Errata& Errata::note_localized(std::string_view const& text, std::optional<Severity> severity) { auto d = this->data(); - Annotation *n = d->_arena.make<Annotation>(text, severity, d->_level); + Annotation *n = d->_arena.make<Annotation>(text, severity); d->_notes.append(n); return *this; } @@ -107,8 +107,9 @@ Errata::alloc(size_t n) { Errata& Errata::note(const self_type& that) { - for (auto const& m : that) { - this->note(m._text); + auto d = this->data(); + for (auto const& annotation : that) { + d->_notes.append(d->_arena.make<Annotation>(d->localize(annotation._text), annotation._severity, annotation._level + 1)); } return *this; }
