Skip to content

Use params ReadOnlySpan<> feature #373

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

Merged
merged 2 commits into from
Apr 17, 2025
Merged

Conversation

SergeiPavlov
Copy link
Collaborator

Sometime it allows to avoid array allocation

@snaumenko-st snaumenko-st requested a review from Copilot April 17, 2025 13:03
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates multiple API signatures to use the new ReadOnlySpan-based overloads in place of traditional arrays to help avoid unnecessary allocations. Key changes include updating identifier quoting methods, translation functions, key construction, and internal extractor methods across several modules to adopt the new language feature.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Orm/Xtensive.Orm/Sql/SqlHelper.cs Updated methods to accept ReadOnlySpan for identifier quoting.
Orm/Xtensive.Orm/Sql/Compiler/SqlTranslator.cs Changed parameters to ReadOnlySpan in translation methods.
Orm/Xtensive.Orm/Sql/Compiler/Internals/PostCompiler.cs Adopted new array literal syntax when quoting names.
Orm/Xtensive.Orm/Reflection/MethodHelper.cs Replaced object[] parameters with ReadOnlySpan and removed redundant null checks.
Orm/Xtensive.Orm/Orm/QueryEndpoint.cs Adjusted key retrieval calls to use the new syntax for ReadOnlySpan.
Orm/Xtensive.Orm/Orm/Linq/Translator.Materialization.cs Updated method call parameters to use the new array literal syntax.
Orm/Xtensive.Orm/Orm/Key.cs Modified key creation to accept ReadOnlySpan.
Orm/Xtensive.Orm/Orm/Internals/KeyFactory.cs Updated signature to use ReadOnlySpan for key materialization.
Orm/Xtensive.Orm/Orm/Entity.cs Changed entity constructors to use ReadOnlySpan in place of object[].
Orm/Xtensive.Orm.SqlServer/Sql.Drivers.SqlServer/v09/Extractor.cs Modified usage of QuoteIdentifierWithBrackets to use new array literal.
Orm/Xtensive.Orm.PostgreSql/Sql.Drivers.PostgreSql/v8_0/Extractor.cs Updated quoting of schema and database names to use new array literal syntax.

@SergeiPavlov SergeiPavlov merged commit 5f5c254 into master-servicetitan Apr 17, 2025
5 checks passed
@SergeiPavlov SergeiPavlov deleted the ReadOnlySpan branch April 17, 2025 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants