Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
sammycage committed Sep 19, 2024
1 parent 10d9401 commit 91f5454
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions source/lunasvg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ bool Element::hasAttribute(const std::string& name) const

const std::string& Element::getAttribute(const std::string& name) const
{
if(m_element == nullptr)
return emptyString;
return m_element->getAttribute(name);
if(m_element)
return m_element->getAttribute(name);
return emptyString;
}

void Element::setAttribute(const std::string& name, const std::string& value)
Expand Down
2 changes: 1 addition & 1 deletion source/svgelement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ SVGRootElement* SVGNode::rootElement() const

ElementID elementid(const std::string_view& name)
{
const struct {
static const struct {
std::string_view name;
ElementID value;
} table[] = {
Expand Down
4 changes: 2 additions & 2 deletions source/svgproperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace lunasvg {

PropertyID propertyid(const std::string_view& name)
{
const struct {
static const struct {
std::string_view name;
PropertyID value;
} table[] = {
Expand Down Expand Up @@ -68,7 +68,7 @@ PropertyID propertyid(const std::string_view& name)

PropertyID csspropertyid(const std::string_view& name)
{
const struct {
static const struct {
std::string_view name;
PropertyID value;
} table[] = {
Expand Down

0 comments on commit 91f5454

Please sign in to comment.