Skip to content

Commit

Permalink
Small improvement of MLXMLNode
Browse files Browse the repository at this point in the history
  • Loading branch information
tmolitor-stud-tu committed Sep 8, 2024
1 parent 5c00ba6 commit fd8ef98
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Monal/Classes/MLXMLNode.m
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ +(BOOL) supportsSecureCoding

-(id) copyWithZone:(NSZone*) zone
{
MLXMLNode* copy = [[[self class] alloc] initWithElement:_element];
MLXMLNode* copy = [[[self class] alloc] initWithElement:[_element copy]];
copy.attributes = [[NSMutableDictionary alloc] initWithDictionary:_attributes copyItems:YES];
for(MLXMLNode* child in _children)
[copy addChildNode:child];
Expand All @@ -219,7 +219,7 @@ -(id) shallowCopy

-(id) shallowCopyWithData:(BOOL) copyData
{
MLXMLNode* copy = [[[self class] alloc] initWithElement:_element];
MLXMLNode* copy = [[[self class] alloc] initWithElement:[_element copy]];
copy.attributes = [[NSMutableDictionary alloc] initWithDictionary:_attributes copyItems:YES];
if(copyData)
copy.data = _data ? [_data copy] : nil;
Expand Down Expand Up @@ -256,7 +256,7 @@ -(MLXMLNode*) addChildNodeWithoutCopy:(MLXMLNode*) child
//namespace inheritance (will be stripped by XMLString later on)
//we do this here to make sure manual created nodes always have a namespace like the nodes created by the xml parser do
if(!insertedChild.attributes[@"xmlns"])
insertedChild.attributes[@"xmlns"] = _attributes[@"xmlns"];
insertedChild.attributes[@"xmlns"] = [_attributes[@"xmlns"] copy];
[_children addObject:insertedChild];
[self invalidateUpstreamCache];
//this one can be removed if the query path component ".." is removed from our language
Expand Down

0 comments on commit fd8ef98

Please sign in to comment.