From 10f65003a8fb70511b16f44c1df917356d370c30 Mon Sep 17 00:00:00 2001
From: Samuel Ugochukwu <sammycageagle@gmail.com>
Date: Fri, 3 Jan 2025 19:31:25 +0100
Subject: [PATCH] Refactoring

---
 source/svgelement.cpp |  5 -----
 source/svgelement.h   | 11 ++++++-----
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/source/svgelement.cpp b/source/svgelement.cpp
index efcf5a2..d3d9f72 100644
--- a/source/svgelement.cpp
+++ b/source/svgelement.cpp
@@ -10,11 +10,6 @@
 
 namespace lunasvg {
 
-SVGRootElement* SVGNode::rootElement() const
-{
-    return document()->rootElement();
-}
-
 ElementID elementid(const std::string_view& name)
 {
     static const struct {
diff --git a/source/svgelement.h b/source/svgelement.h
index 6aa7a1b..f9421a8 100644
--- a/source/svgelement.h
+++ b/source/svgelement.h
@@ -1,14 +1,14 @@
 #ifndef LUNASVG_SVGELEMENT_H
 #define LUNASVG_SVGELEMENT_H
 
+#include "lunasvg.h"
+#include "svgproperty.h"
+
 #include <string>
 #include <forward_list>
 #include <list>
 #include <map>
 
-#include "svgproperty.h"
-#include "lunasvg.h"
-
 namespace lunasvg {
 
 class Document;
@@ -29,10 +29,11 @@ class SVGNode {
     virtual bool isGeometryElement() const { return false; }
     virtual bool isTextPositioningElement() const { return false; }
 
-    SVGRootElement* rootElement() const;
     Document* document() const { return m_document; }
-    void setParent(SVGElement* parent) { m_parent = parent; }
+    SVGRootElement* rootElement() const { return m_document->rootElement(); }
+
     SVGElement* parent() const { return m_parent; }
+    void setParent(SVGElement* parent) { m_parent = parent; }
 
     virtual std::unique_ptr<SVGNode> clone(bool deep) const = 0;