Merge condition check codes in compose() method#6983
Conversation
kdk
left a comment
There was a problem hiding this comment.
Thanks @QianJianhua1 , I agree these two if statements could be merged (though I would expect the performance improvement in doing so to be small). However, to me, I find the updated version less readable than the original (having this as two conditions did separate out the "merge _data lists" phase from the "update ParameterTable" phase, and the comment # just append new parameters is now misplaced). Is there a way the readability of the original could be preserved?
|
Thank you @kdk Partly agree with you. But if you think of "update _data" and "update parameter" as one continuous process, you might think otherwise. In other words, after _data is updated, parameter must be updated. |
javabster
left a comment
There was a problem hiding this comment.
This lgtm, thanks @QianJianhua1!
|
On this one I agree with @QianJianhua1 about the newer readability: in the previous version with its split if statements, it wasn't super clear why you needed to invalidate the parameter table in the second |
kdk
left a comment
There was a problem hiding this comment.
Thanks for the updates @QianJianhua1 , this LGTM!
Summary
Merge condition check codes in compose() method.
Details and comments
Merge the two consecutive "if front" check codes into one.