Skip to content

Rewrite Values#clone for readability and efficiency#73

Merged
kleinj merged 1 commit into
prismmodelchecker:masterfrom
merkste:improve-values-clone
Apr 25, 2018
Merged

Rewrite Values#clone for readability and efficiency#73
kleinj merged 1 commit into
prismmodelchecker:masterfrom
merkste:improve-values-clone

Conversation

@merkste

@merkste merkste commented Apr 24, 2018

Copy link
Copy Markdown
Contributor

The current implementation is a bit cumbersome and potentially inefficient due to resizing of the array lists during adding. This PR resolves this issue and marks the class cloneable.

@kleinj

kleinj commented Apr 24, 2018

Copy link
Copy Markdown
Member

Looks good to me. I guess you have tested it in one of your branches? As far as I can tell Values.clone() is never actually used in the main PRISM branch and thus not covered by the test suite.

In the clone() method, you are not simply calling new Values(Values other) on the chance that someone derives a class from Values?

@merkste merkste force-pushed the improve-values-clone branch from c64ebf4 to 4aeb20e Compare April 24, 2018 19:49
@merkste

merkste commented Apr 24, 2018

Copy link
Copy Markdown
Contributor Author
  1. Yes, in my local branches and PR Do not unfold the AST on deep-copying #66 actually relies on clone, too.
  2. Yes as well, I didn't want to break inheritance. Using a copy constructor in clone-Methods can easily lead to very subtle bugs.

@kleinj kleinj merged commit e038bad into prismmodelchecker:master Apr 25, 2018
@merkste merkste deleted the improve-values-clone branch May 25, 2018 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants