Skip to content

Add AttributeBag.Clone - #29

Open
danslo wants to merge 1 commit into
rectorphp:mainfrom
danslo:attribute-bag-clone
Open

danslo wants to merge 1 commit into
rectorphp:mainfrom
danslo:attribute-bag-clone

Conversation

@danslo

@danslo danslo commented Nov 18, 2026

Copy link
Copy Markdown

A node copied by value keeps the same attribute map as the original, so setting an attribute on the copy changed the original too. Clone returns a bag with its own copy of the map, for code that deep-copies nodes. Added a test.

A copied node shares its attribute map with the original unless the bag is cloned, so setting an attribute on the copy changed the original.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant