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

Avoid creating unnecessary intermediate strings #3439

Merged
merged 7 commits into from
Aug 24, 2024

Commits on Aug 20, 2024

  1. Refactor JSON serialization to use MemoryStream

    Replaced StringWriter with MemoryStream and StreamWriter for JSON serialization to improve efficiency. JsonWriter is now initialized with StreamWriter. Adjusted indentation levels in ProcessStructure and ProcessMembers methods. Final request content is now obtained as a byte array from MemoryStream.
    paulomorgado committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    472be25 View commit details
    Browse the repository at this point in the history
  2. Update generator/ServiceClientGeneratorLib/Generators/Marshallers/Jso…

    …nRPCRequestMarshaller.tt
    
    Co-authored-by: Stuart Lang <stuart.b.lang@gmail.com>
    paulomorgado and slang25 committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    041d9f0 View commit details
    Browse the repository at this point in the history
  3. Update generator/ServiceClientGeneratorLib/Generators/Marshallers/Jso…

    …nRPCRequestMarshaller.tt
    
    Co-authored-by: Stuart Lang <stuart.b.lang@gmail.com>
    paulomorgado and slang25 committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    d2241c1 View commit details
    Browse the repository at this point in the history
  4. Simplify StreamWriter instantiation

    Refactor the instantiation of the `StreamWriter` object within a `using` statement by removing unnecessary parameters. The original code included `null` for encoding, `-1` for buffer size, and `true` for leaving the stream open. The updated code uses the default constructor, which only requires the `MemoryStream` object, as the default behavior is sufficient for the intended use case.
    paulomorgado committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    ee45001 View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2024

  1. Add InvariantCultureStreamWriter for consistent formatting

    Introduce InvariantCultureStreamWriter class to enforce invariant
    culture formatting. Replace StreamWriter with
    InvariantCultureStreamWriter in JsonRPCRequestMarshaller.tt to
    ensure consistent JSON formatting regardless of system culture.
    paulomorgado committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    28dcf10 View commit details
    Browse the repository at this point in the history

Commits on Aug 24, 2024

  1. Configuration menu
    Copy the full SHA
    832e25c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d86c980 View commit details
    Browse the repository at this point in the history