Skip to content

Commit

Permalink
Merge pull request #57 from Cysharp/hadashiA/update-unity
Browse files Browse the repository at this point in the history
Update unity source codes
  • Loading branch information
hadashiA authored Sep 15, 2023
2 parents 4e4bcb0 + caf660d commit ccc8faa
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/Ulid.Unity/Assets/Scripts/Ulid/Ulid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ internal Ulid(long timestampMilliseconds, XorShift64 random)
}
else
{
this.timestamp0 = Unsafe.Add(ref firstByte, 0);
this.timestamp1 = Unsafe.Add(ref firstByte, 1);
this.timestamp2 = Unsafe.Add(ref firstByte, 2);
this.timestamp3 = Unsafe.Add(ref firstByte, 3);
this.timestamp4 = Unsafe.Add(ref firstByte, 4);
this.timestamp5 = Unsafe.Add(ref firstByte, 5);
this.timestamp0 = Unsafe.Add(ref firstByte, 2);
this.timestamp1 = Unsafe.Add(ref firstByte, 3);
this.timestamp2 = Unsafe.Add(ref firstByte, 4);
this.timestamp3 = Unsafe.Add(ref firstByte, 5);
this.timestamp4 = Unsafe.Add(ref firstByte, 6);
this.timestamp5 = Unsafe.Add(ref firstByte, 7);
}

// Get first byte of randomness from Ulid Struct.
Expand All @@ -163,12 +163,12 @@ internal Ulid(long timestampMilliseconds, ReadOnlySpan<byte> randomness)
}
else
{
this.timestamp0 = Unsafe.Add(ref firstByte, 0);
this.timestamp1 = Unsafe.Add(ref firstByte, 1);
this.timestamp2 = Unsafe.Add(ref firstByte, 2);
this.timestamp3 = Unsafe.Add(ref firstByte, 3);
this.timestamp4 = Unsafe.Add(ref firstByte, 4);
this.timestamp5 = Unsafe.Add(ref firstByte, 5);
this.timestamp0 = Unsafe.Add(ref firstByte, 2);
this.timestamp1 = Unsafe.Add(ref firstByte, 3);
this.timestamp2 = Unsafe.Add(ref firstByte, 4);
this.timestamp3 = Unsafe.Add(ref firstByte, 5);
this.timestamp4 = Unsafe.Add(ref firstByte, 6);
this.timestamp5 = Unsafe.Add(ref firstByte, 7);
}

ref var src = ref MemoryMarshal.GetReference(randomness); // length = 10
Expand Down

0 comments on commit ccc8faa

Please sign in to comment.