typelevel / scalacheck

Property-based testing for Scala
http://www.scalacheck.org
BSD 3-Clause "New" or "Revised" License
1.94k stars 405 forks source link

Making the code more concise and readable #943

Closed aashish2054 closed 1 year ago

aashish2054 commented 1 year ago

The for-comprehension in the optimized code replaces the two exists statements, making the code more concise and readable. The code performs the same checks as the original code, but in a more elegant and readable way. Additionally, the yield statement evaluates to true if no initSut or runningSut matches the name of the new state, and false otherwise. The final line checks whether a runningSut matches the name of the new state, and returns the negation of this result. Overall, the optimized code is more concise, readable, and efficient than the original code.