aboutsummaryrefslogtreecommitdiff
path: root/include/openvic-dataloader/Error.hpp
diff options
context:
space:
mode:
author George L. Albany <Megacake1234@gmail.com>2024-06-22 21:58:35 +0200
committer GitHub <noreply@github.com>2024-06-22 21:58:35 +0200
commitdeed8ec0ae23651529a58125012c1b4aab015d02 (patch)
tree51ca6d5948e92be37b9ee6674cb96801d2cd03f8 /include/openvic-dataloader/Error.hpp
parent8b623bf4087aa360842ad31145d4ab6946cee9aa (diff)
parent1a694a8b26a441b12547057d6e0be61a111cced3 (diff)
Merge pull request #49 from OpenVicProject/add/unit-testing
Add unit testing
Diffstat (limited to 'include/openvic-dataloader/Error.hpp')
-rw-r--r--include/openvic-dataloader/Error.hpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/openvic-dataloader/Error.hpp b/include/openvic-dataloader/Error.hpp
index a2e13fe..343abd9 100644
--- a/include/openvic-dataloader/Error.hpp
+++ b/include/openvic-dataloader/Error.hpp
@@ -117,11 +117,10 @@ namespace ovdl::error {
protected:
explicit AnnotatedError(dryad::node_ctor ctor, ErrorKind kind) : node_base(ctor, kind) {
insert_child_list_after(nullptr, AnnotationList {});
- _last_annotation = nullptr;
}
private:
- Annotation* _last_annotation;
+ Annotation* _last_annotation = nullptr;
};
struct ParseError : dryad::abstract_node_range<AnnotatedError, ErrorKind::FirstParseError, ErrorKind::LastParseError> {
@@ -207,7 +206,7 @@ namespace ovdl::error {
inline void AnnotatedError::push_back(AnnotationList p_annotations) {
if (p_annotations.empty()) return;
- insert_child_list_after(annotations().end().deref(), p_annotations);
- _last_annotation = *p_annotations.end();
+ insert_child_list_after(_last_annotation, p_annotations);
+ _last_annotation = p_annotations.back();
}
} \ No newline at end of file