-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Write and read uniformly in objectwriter/objectreader #71877
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
Conversation
case TypeCode.Null: return null; | ||
case TypeCode.Boolean_True: return true; | ||
case TypeCode.Boolean_False: return false; | ||
case TypeCode.Int8: return _reader.ReadSByte(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
direct access of the reader makes the code harder to update since it's the reader itself that is being swapped out in the new world.
if (value == null) | ||
{ | ||
_writer.Write((byte)TypeCode.Null); | ||
WriteByte((byte)TypeCode.Null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with direct access of the writer.
This is for "_writer.Write(word);" in case codeflow messed that up In reply to: 1917877589 Refers to: src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Serialization/ObjectWriter.cs:607 in 432d746. [](commit_id = 432d746, deletion_comment = False) |
Should WriteVersion be modified call WriteByte? In reply to: 1917878270 Refers to: src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Serialization/ObjectWriter.cs:607 in 432d746. [](commit_id = 432d746, deletion_comment = False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will help with a larger refactoring i'm making here to make it so that these readers/writers can be used efficiently on pipes.