summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Text/DecoderBestFitFallback.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/Text/DecoderBestFitFallback.cs')
-rw-r--r--src/mscorlib/src/System/Text/DecoderBestFitFallback.cs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mscorlib/src/System/Text/DecoderBestFitFallback.cs b/src/mscorlib/src/System/Text/DecoderBestFitFallback.cs
index 5c1dcd9682..6389b4b141 100644
--- a/src/mscorlib/src/System/Text/DecoderBestFitFallback.cs
+++ b/src/mscorlib/src/System/Text/DecoderBestFitFallback.cs
@@ -10,6 +10,7 @@ namespace System.Text
using System;
using System.Text;
using System.Threading;
+ using System.Diagnostics;
using System.Diagnostics.Contracts;
[Serializable]
@@ -101,7 +102,7 @@ namespace System.Text
public override bool Fallback(byte[] bytesUnknown, int index)
{
// We expect no previous fallback in our buffer
- Contract.Assert(iCount < 1, "[DecoderReplacementFallbackBuffer.Fallback] Calling fallback without a previously empty buffer");
+ Debug.Assert(iCount < 1, "[DecoderReplacementFallbackBuffer.Fallback] Calling fallback without a previously empty buffer");
cBestFit = TryBestFit(bytesUnknown);
if (cBestFit == '\0')
@@ -155,7 +156,6 @@ namespace System.Text
}
// Clear the buffer
- [System.Security.SecuritySafeCritical] // overrides public transparent member
public override unsafe void Reset()
{
iCount = -1;
@@ -163,7 +163,6 @@ namespace System.Text
}
// This version just counts the fallback and doesn't actually copy anything.
- [System.Security.SecurityCritical] // auto-generated
internal unsafe override int InternalFallback(byte[] bytes, byte* pBytes)
// Right now this has both bytes and bytes[], since we might have extra bytes, hence the
// array, and we might need the index, hence the byte*
@@ -212,7 +211,7 @@ namespace System.Text
if (cTest == cCheck)
{
// We found it
- Contract.Assert(index + 1 < oFallback.arrayBestFit.Length,
+ Debug.Assert(index + 1 < oFallback.arrayBestFit.Length,
"[InternalDecoderBestFitFallbackBuffer.TryBestFit]Expected replacement character at end of array");
return oFallback.arrayBestFit[index + 1];
}
@@ -233,7 +232,7 @@ namespace System.Text
if (oFallback.arrayBestFit[index] == cCheck)
{
// We found it
- Contract.Assert(index + 1 < oFallback.arrayBestFit.Length,
+ Debug.Assert(index + 1 < oFallback.arrayBestFit.Length,
"[InternalDecoderBestFitFallbackBuffer.TryBestFit]Expected replacement character at end of array");
return oFallback.arrayBestFit[index + 1];
}