Skip to content

Use AsSpan/AsMemory slice constructor - #14265

Merged
Ilya (iSazonov) merged 2 commits into
PowerShell:masterfrom
xtqqczze:asspan-slice
Nov 27, 2020
Merged

Use AsSpan/AsMemory slice constructor#14265
Ilya (iSazonov) merged 2 commits into
PowerShell:masterfrom
xtqqczze:asspan-slice

Conversation

@xtqqczze

Copy link
Copy Markdown
Contributor

Follow-up to #13500.

AsSpan().Slice(start, length) -> AsSpan(start, length)

Micro-benchmarks show decrease in code size and ~1.6x speedup.

@xtqqczze

Copy link
Copy Markdown
Contributor Author

Ilya (@iSazonov) Should we label the arguments, i.e. AsMemory(0, index) -> AsMemory(start: 0, length: index)?

@iSazonov Ilya (iSazonov) added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Nov 25, 2020
@iSazonov

Copy link
Copy Markdown
Collaborator

Ilya (@iSazonov) Should we label the arguments, i.e. AsMemory(0, index) -> AsMemory(start: 0, length: index)?

I think we can skip this as obvious.

@iSazonov
Ilya (iSazonov) merged commit dc9ecd9 into PowerShell:master Nov 27, 2020
@iSazonov Ilya (iSazonov) added this to the 7.2.0-preview.2 milestone Nov 27, 2020
@xtqqczze
xtqqczze deleted the asspan-slice branch November 27, 2020 12:04
@ghost

Copy link
Copy Markdown

🎉v7.2.0-preview.2 has been released which incorporates this pull request.:tada:

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
* Use AsSpan slice constructor

* Use AsMemory slice constructor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants