Skip to content

Commit

Permalink
refactor: Slight size improvement (I think)
Browse files Browse the repository at this point in the history
  • Loading branch information
rschristian committed Apr 30, 2024
1 parent 8d0eb69 commit c17c7c0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/diff/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,15 +403,15 @@ function diffElementNodes(
return document.createTextNode(newProps);
}

if (namespace == 2) {
dom = document.createElementNS('http://www.w3.org/2000/svg', nodeType);
} else if (namespace == 3) {
if (namespace == 1) {
dom = document.createElement(nodeType, newProps.is && newProps);
} else {
dom = document.createElementNS(
'http://www.w3.org/1998/Math/MathML',
namespace == 2
? 'http://www.w3.org/2000/svg'
: 'http://www.w3.org/1998/Math/MathML',
nodeType
);
} else {
dom = document.createElement(nodeType, newProps.is && newProps);
}

// we created a new parent, so none of the previously attached children can be reused:
Expand Down

0 comments on commit c17c7c0

Please sign in to comment.