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

Update unity source codes #57

Merged
merged 1 commit into from
Sep 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading