From 0853df69e82c4e06b8ebfd407dc7e0ff4f9243c6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 2 Jul 2025 14:25:40 +0000 Subject: [PATCH 1/3] Initial plan From 363cb0424314c1723d9600761ddc34d1e9969b03 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 2 Jul 2025 14:29:32 +0000 Subject: [PATCH 2/3] Clarify that unsafe code enables performance optimizations rather than providing them automatically Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com> --- docs/csharp/language-reference/unsafe-code.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/language-reference/unsafe-code.md b/docs/csharp/language-reference/unsafe-code.md index f3e4f95b032de..6551da3b720dd 100644 --- a/docs/csharp/language-reference/unsafe-code.md +++ b/docs/csharp/language-reference/unsafe-code.md @@ -22,7 +22,7 @@ C# supports an [`unsafe`](keywords/unsafe.md) context, in which you can write *u Unsafe code has the following properties: - Methods, types, and code blocks can be defined as unsafe. -- In some cases, unsafe code can increase an application's performance by removing array bounds checks. +- Unsafe code enables algorithms that can potentially increase an application's performance by using pointers to avoid array bounds checks. - Unsafe code is required when you call native functions that require pointers. - Using unsafe code introduces security and stability risks. - The code that contains unsafe blocks must be compiled with the [**AllowUnsafeBlocks**](compiler-options/language.md#allowunsafeblocks) compiler option. From 9926bc2598cbd6d21c7cf924d1fd85730d9c8f39 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 3 Jul 2025 21:47:05 +0000 Subject: [PATCH 3/3] Fix wording to address review feedback - focus on direct memory access capabilities rather than algorithms Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com> --- docs/csharp/language-reference/unsafe-code.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/csharp/language-reference/unsafe-code.md b/docs/csharp/language-reference/unsafe-code.md index 6551da3b720dd..a6fb577315963 100644 --- a/docs/csharp/language-reference/unsafe-code.md +++ b/docs/csharp/language-reference/unsafe-code.md @@ -22,7 +22,7 @@ C# supports an [`unsafe`](keywords/unsafe.md) context, in which you can write *u Unsafe code has the following properties: - Methods, types, and code blocks can be defined as unsafe. -- Unsafe code enables algorithms that can potentially increase an application's performance by using pointers to avoid array bounds checks. +- In some cases, unsafe code can increase an application's performance by enabling direct memory access through pointers to avoid array bounds checks. - Unsafe code is required when you call native functions that require pointers. - Using unsafe code introduces security and stability risks. - The code that contains unsafe blocks must be compiled with the [**AllowUnsafeBlocks**](compiler-options/language.md#allowunsafeblocks) compiler option.