Skip to content

Commit

Permalink
不要なstructuredCloneを削除
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba committed Nov 10, 2023
1 parent 2ad775e commit 1b67f74
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/store/utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,15 @@ export class TuningTranscription {
* 実際には"ズ"などの文字列部分は{text: "ズ"...}のようなデータ構造になっている。
* [ U, U, {text: "ズ"...}, {text: "ン"...}, {text: "ダ"...}, {text: "ナ"...}, {text: "ノ"...}, U, U ]
*/
createDiffPatch() {
private createDiffPatch() {
const before = structuredClone(this.beforeAccent);
const after = structuredClone(this.afterAccent);

const beforeFlatArray = this.createFlatArray(before, "moras");
const afterFlatArray = this.createFlatArray(after, "moras");
const diffed = diffArrays(
this.createFlatArray(structuredClone(beforeFlatArray), "text"),
this.createFlatArray(structuredClone(afterFlatArray), "text")
this.createFlatArray(beforeFlatArray, "text"),
this.createFlatArray(afterFlatArray, "text")
);

// FIXME: beforeFlatArrayを破壊的に変更しなくても良いようにしてasを不要にする
Expand Down Expand Up @@ -260,7 +260,7 @@ export class TuningTranscription {
* あとは一致したモーラを転写するだけ。
*
*/
mergeAccentPhrases(moraPatch: (Mora | undefined)[]): AccentPhrase[] {
private mergeAccentPhrases(moraPatch: (Mora | undefined)[]): AccentPhrase[] {
const after: AccentPhrase[] = structuredClone(this.afterAccent);
let moraPatchIndex = 0;

Expand Down

0 comments on commit 1b67f74

Please sign in to comment.