Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h5.core.controller()のparam(第3引数)がDeepCopyされる #163

Closed
simdy opened this issue Feb 12, 2013 · 1 comment
Closed

h5.core.controller()のparam(第3引数)がDeepCopyされる #163

simdy opened this issue Feb 12, 2013 · 1 comment
Assignees
Labels
Milestone

Comments

@simdy
Copy link
Member

simdy commented Feb 12, 2013

ユーザーパラメータがDeepCopyされてしまい、同じオブジェクトを渡すことができない。

@ghost ghost assigned simdy Feb 12, 2013
@simdy
Copy link
Member Author

simdy commented Feb 13, 2013

パラメータのクローン自体を行わないようにする。

ここで渡すオブジェクトが「パラメータとして渡しているものである」ことはコードから意図が明確。
ShallowCopyをする方法も考えられるが、通常のメソッド呼び出しとあえて区別するほどの必要はないと思われる。

ShallowCopyをしない場合、パラメータとして渡したオブジェクトを後から書き換えると
値が変わってしまう問題があるが、中にオブジェクトを入れた場合結局書き換えられるので、
もっとも外側のインスタンスだけを守っても中途半端である。

simdy pushed a commit to hifive-labs/hifivemain that referenced this issue Feb 15, 2013
@simdy simdy closed this as completed Feb 15, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant