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

improve: [0577] 二次元配列のコピー関数の実体をstructuredCloneに変更 #1304

Merged
merged 1 commit into from Aug 21, 2022

Conversation

cwtickle
Copy link
Owner

🔨 変更内容 / Details of Changes

  1. 二次元配列のコピー関数(copyArray2d)の処理を
    JSON.parse(JSON.stringify(data))からstructuredClone(data)に変更しました。
    https://developer.mozilla.org/en-US/docs/Web/API/structuredClone

現状、ほとんどのブラウザはstructuredCloneを使える状況にあるため、差し替えても影響は無いと思います。
https://caniuse.com/?search=structuredClone

🔖 関連Issue, 変更理由 / Related Issues, Reason for Changes

  1. 今後、ディープコピーしている箇所の処理統一のため。

📷 スクリーンショット / Screenshot

📝 その他コメント / Other Comments

  • 今回の変更はディープコピーが本当に必要な箇所に絞っており、それ以外の箇所はそのままです。
    今後、structuredCloneを使うべきかどうかは個別に検討予定です。

@codeclimate
Copy link

codeclimate bot commented Aug 21, 2022

Code Climate has analyzed commit 36114c1 and detected 0 issues on this pull request.

View more on Code Climate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant