Skip to content

Commit 4f874dc

Browse files
authored
Merge pull request #6 from esnya/codex/replace-array-fill-with-for-loop-in-constructors
Fix mouth and eye data initialization
2 parents bf3828f + 88674c6 commit 4f874dc

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

ViveStreamingEyes.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ private readonly struct EyeData
1414
public EyeData()
1515
{
1616
data = new float[(int)FaceData.EyeDataIndex.MAX];
17-
Array.Fill(data, float.NaN);
17+
for (var i = 0; i < data.Length; i++)
18+
{
19+
data[i] = float.NaN;
20+
}
1821
}
1922

2023
public float this[FaceData.EyeDataIndex index] => data[(int)index];

ViveStreamingMouth.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ private readonly struct MouthData
1414
public MouthData()
1515
{
1616
data = new float[(int)FaceData.LipDataIndex.Max];
17-
Array.Fill(data, float.NaN);
17+
for (var i = 0; i < data.Length; i++)
18+
{
19+
data[i] = float.NaN;
20+
}
1821
}
1922

2023
public readonly float this[FaceData.LipDataIndex index] => data[(int)index];

0 commit comments

Comments
 (0)