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

Remove VersionStamp serialization #73359

Merged
Merged
Show file tree
Hide file tree
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
35 changes: 0 additions & 35 deletions src/Workspaces/Core/Portable/Workspace/Solution/VersionStamp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,41 +168,6 @@ public bool Equals(VersionStamp version)
public static bool operator !=(VersionStamp left, VersionStamp right)
=> !left.Equals(right);

/// <summary>
/// Check whether given persisted version is re-usable. Used by VS for Mac
/// </summary>
internal static bool CanReusePersistedVersion(VersionStamp baseVersion, VersionStamp persistedVersion)
{
if (baseVersion == persistedVersion)
{
return true;
}

// there was a collision, we can't use these
if (baseVersion._localIncrement != 0 || persistedVersion._localIncrement != 0)
{
return false;
}

return baseVersion._utcLastModified == persistedVersion._utcLastModified;
}

internal void WriteTo(ObjectWriter writer)
{
writer.WriteInt64(_utcLastModified.ToBinary());
writer.WriteInt32(_localIncrement);
writer.WriteInt32(_globalIncrement);
}

internal static VersionStamp ReadFrom(ObjectReader reader)
{
var raw = reader.ReadInt64();
var localIncrement = reader.ReadInt32();
var globalIncrement = reader.ReadInt32();

return new VersionStamp(DateTime.FromBinary(raw), localIncrement, globalIncrement);
}

private static int GetGlobalVersion(VersionStamp version)
{
// global increment < 0 means it is a global version which has its global increment in local increment
Expand Down
37 changes: 0 additions & 37 deletions src/Workspaces/CoreTest/SerializationTests.cs

This file was deleted.

Loading