// the Deactivate method publicly.
#if DEBUG
- int activateCount = Interlocked.Decrement(ref _activateCount);
+ Interlocked.Decrement(ref _activateCount);
#endif // DEBUG
{
if (FastGetHashCode(firstString) == FastGetHashCode(secondString))
{
- int comparisons = firstString.Length;
while (index > 0)
{
index--;
else
{
// "Observe" any exception, ignoring it to prevent the unobserved exception event from being raised.
- t.AsTask().ContinueWith(p => { Exception ignored = p.Exception; },
+ t.AsTask().ContinueWith(p => { _ = p.Exception; },
CancellationToken.None,
TaskContinuationOptions.OnlyOnFaulted | TaskContinuationOptions.ExecuteSynchronously,
TaskScheduler.Default);
// Define property as:
// public string AssemblyName {get { return this.assemblyName; } }
- PropertyBuilder getterPropertyBuilder = attributeTypeBuilder.DefineProperty(
- "AssemblyName",
- PropertyAttributes.None,
- CallingConventions.HasThis,
- returnType: typeof(string),
- parameterTypes: null);
+ _ = attributeTypeBuilder.DefineProperty(
+ "AssemblyName",
+ PropertyAttributes.None,
+ CallingConventions.HasThis,
+ returnType: typeof(string),
+ parameterTypes: null);
MethodBuilder getterMethodBuilder = attributeTypeBuilder.DefineMethod(
"get_AssemblyName",
int paramCount = mp.Params.Count;
TypeArray @params = mp.Params;
int iDst = 0;
- MethodSymbol m = mp as MethodSymbol;
int argCount = ExpressionIterator.Count(argsPtr);
Debug.Assert(!@params.Items.Any(p => p is ArgumentListType)); // We should never have picked a varargs method to bind to.
// if we are going to do anything with the array, we will need Length anyways
// so touching it, and potentially causing a cache miss, is not going to be an
// extra expense.
- var unused = this.array.Length;
+ _ = this.array.Length;
}
/// <summary>
Enumerator theirs = asSorted.GetEnumerator();
bool mineEnded = !mine.MoveNext(), theirsEnded = !theirs.MoveNext();
T max = Max;
- T min = Min;
while (!mineEnded && !theirsEnded && Comparer.Compare(theirs.Current, max) <= 0)
{
private IEnumerable<Tuple<object, List<Attribute>>> EvaluateThisTypeAgainstTheConvention(Type type)
{
- List<Tuple<object, List<Attribute>>> results = new List<Tuple<object, List<Attribute>>>();
List<Attribute> attributes = new List<Attribute>();
var configuredMembers = new List<Tuple<object, List<Attribute>>>();
int genericArity = 0;
if (type.IsGenericType && type.ContainsGenericParameters)
{
- List<Type> pureGenericParameters = new List<Type>();
TraverseGenericType(type, (Type t) =>
{
if (t.IsGenericParameter)
throw new ArgumentNullException(nameof(instance));
}
- Type type = instance.GetType();
AddProvider(provider, instance);
}
throw new ArgumentNullException(nameof(instance));
}
- Type type = instance.GetType();
-
RemoveProvider(provider, instance);
}
private IEnumerable<Tuple<object, List<Attribute>>> EvaluateThisTypeInfoAgainstTheConvention(TypeInfo typeInfo)
{
- List<Tuple<object, List<Attribute>>> results = new List<Tuple<object, List<Attribute>>>();
List<Attribute> attributes = new List<Attribute>();
var configuredMembers = new List<Tuple<object, List<Attribute>>>();
bool specifiedConstructor = false;
_configPaths = null;
// Force loading of user.config file information under lock.
- ClientConfigPaths configPaths = ConfigPaths;
+ _ = ConfigPaths;
}
}
}
foreach (ConfigurationSection configSection in group.Sections)
{
// Force the section to be read into the cache
- ConfigurationSection section = group.Sections[configSection.SectionInformation.Name];
+ _ = group.Sections[configSection.SectionInformation.Name];
}
foreach (ConfigurationSectionGroup sectionGroup in group.SectionGroups)
ForceGroupsRecursive(group.SectionGroups[sectionGroup.Name]);
}
}
-}
\ No newline at end of file
+}
int rowsAffected = 0;
- System.Data.MissingMappingAction missingMapping = UpdateMappingAction;
DataTableMapping tableMapping = GetTableMappingBySchemaAction(srcTable, srcTable, UpdateMappingAction);
Debug.Assert(null != tableMapping, "null TableMapping when MissingMappingAction.Error");
// This is not valid for Whidbey anymore so the code has been removed
// 2. There is no loop in nested relations
-#if DEBUG
- int numTables = ParentTable.DataSet.Tables.Count;
-#endif
- DataTable dt = ParentTable;
if (ChildTable == ParentTable)
{
{
if (!table.ShouldSerializeLocale())
{
- bool retchk = table.SetLocaleValue(value, false, false);
+ table.SetLocaleValue(value, false, false);
}
}
long logScopeId = DataCommonEventSource.Log.EnterScope("<ds.DataSet.InferSchema|INFO> {0}, mode={1}", ObjectID, mode);
try
{
- string ns = xdoc.DocumentElement.NamespaceURI;
if (null == excludedNamespaces)
{
excludedNamespaces = Array.Empty<string>();
{
if ((rel.Nested) && (rel.ChildTable != this))
{
- DataTable childTable = rel.ChildTable;
-
rel.ChildTable.DoRaiseNamespaceChange();
}
}
// start cloning relation
foreach (DataRelation r in sourceTable.ChildRelations)
{
- DataTable childTable = CloneHierarchy(r.ChildTable, ds, visitedMap);
+ CloneHierarchy(r.ChildTable, ds, visitedMap);
}
return destinationTable;
internal void ReadXDRSchema(XmlReader reader)
{
XmlDocument xdoc = new XmlDocument(); // we may need this to infer the schema
- XmlNode schNode = xdoc.ReadNode(reader); ;
+ xdoc.ReadNode(reader);
//consume and ignore it - No support
}
dataset.Tables.Add(this);
}
- DataTable targetTable = CloneHierarchy(currentTable, DataSet, null);
+ CloneHierarchy(currentTable, DataSet, null);
foreach (DataTable tempTable in tableList)
{
return;
}
- DataTable table = _index != null ? _index.Table : newIndex.Table;
-
if (_index != null)
{
_dvListener.UnregisterListChangedEvent();
/* Check for binary constant */
if (ch == '0' && (text[_pos] == 'x' || text[_pos] == 'X'))
{
- ScanBinaryConstant();
_token = Tokens.BinaryConst;
goto end_loop;
}
_pos++;
}
- private void ScanBinaryConstant()
- {
- char[] text = _text;
- }
-
private void ScanReserved()
{
char[] text = _text;
internal void Check()
{
- Function f = s_funcs[_info];
if (_info < 0)
throw ExprException.UndefinedFunction(_name);
SqlDecimal ret = n;
- int lPrecAdjust = precision - ret._bPrec;//Adjustment to precision
int lScaleAdjust = scale - ret._bScale;//Adjustment to scale
//Adjust scale
if (n.IsNull)
return SqlDecimal.Null;
- byte prec = n.Precision;
int scale = n.Scale;
double dBaseNum = n.ToDouble();
try
{
int count = _table._indexes.Count;
- int rowsCount = _table.Rows.Count;
for (int i = 0; i < count; i++)
{
Index ndx = _table._indexes[i];
try
{
int count = _table._indexes.Count;
- int rowsCount = _table.Rows.Count;
for (int i = 0; i < count; i++)
{
Index ndx = _table._indexes[i];
}
}
int indexNotInCandidates = lenIndexDesc - j;
- int candidatesNotInIndex = _nCandidates - j;
IndexField[] ndxFields = new IndexField[_nCandidates + indexNotInCandidates];
if (equalsOperator)
_recordStates = recordStates;
_comparison = comparison;
- DataColumnCollection columns = table.Columns;
_isSharable = (rowFilter == null) && (comparison == null); // a filter or comparison make an index unsharable
if (null != rowFilter)
{
string strDefault;
DataColumn column;
- string strUse = node.GetAttribute(Keywords.USE);
-
-
-
// Get the name
if (node.Attributes.Count > 0)
{
// the diffgramm always contains sql:before and sql:after pairs
- int iTempDepth = ssync.Depth;
-
diffId = ssync.GetAttribute(Keywords.DIFFID, Keywords.DFFNS);
bool hasErrors = ssync.GetAttribute(Keywords.HASERRORS, Keywords.DFFNS) == Keywords.TRUE;
oldRowRecord = ReadOldRowData(ds, ref tableBefore, ref pos, ssync);
// the diffgramm always contains sql:before and sql:after pairs
- int iTempDepth = ssync.Depth;
-
diffId = ssync.GetAttribute(Keywords.DIFFID, Keywords.DFFNS);
bool hasErrors = ssync.GetAttribute(Keywords.HASERRORS, Keywords.DFFNS) == Keywords.TRUE;
oldRowRecord = ReadOldRowData(_dataSet, ref tableBefore, ref pos, ssync);
int count = 0;
for (int i = 0; i < node.Attributes.Count; i++)
{
- XmlAttribute attr = node.Attributes[i];
if (!FExcludedNamespace(node.Attributes[i].NamespaceURI))
count++;
}
DataTable table = row.Table;
DataColumnCollection columns = table.Columns;
int iColumn = (col != null) ? col.Ordinal - 1 : columns.Count - 1;
- int cColumns = columns.Count;
DataRowVersion rowVersion = (row.RowState == DataRowState.Detached) ? DataRowVersion.Proposed : DataRowVersion.Current;
for (; iColumn >= 0; iColumn--)
XPathNodePointer xp2 = other.Clone((DataDocumentXPathNavigator)(other._owner.Target));
while (xp1.MoveToNextNamespace(XPathNamespaceScope.All))
{
- if (xp1.IsSamePosition(other))
+ if (xp1.IsSamePosition(xp2))
return XmlNodeOrder.Before;
}
return XmlNodeOrder.After;
attrName = "xmlns";
RealFoliate();
XmlNode node = _node;
- XmlNodeType nt = node.NodeType;
XmlAttribute attr = null;
XmlBoundElement be = null;
while (node != null)
// before iteration, so iteration will not cause foliation (and as a result of this, creation of new nodes).
XmlNodeList tempNodeList = base.GetElementsByTagName(name);
- int tempint = tempNodeList.Count;
+ _ = tempNodeList.Count;
return tempNodeList;
}
}
foreach (DataRow r in t.Rows)
{
Debug.Assert(r.Element == null);
- XmlBoundElement rowElem = AttachBoundElementToDataRow(r);
+ AttachBoundElementToDataRow(r);
switch (r.RowState)
{
{
DataRow row = args.Row;
DataColumn col = args.Column;
- object oVal = args.ProposedValue;
if (row.RowState == DataRowState.Detached)
{
DataRow row = rowElement.Row;
Debug.Assert(row != null);
- DataTable table = row.Table;
Hashtable foundColumns = new Hashtable();
string xsi_attrVal = string.Empty;
// before iteration, so iteration will not cause foliation (and as a result of this, creation of new nodes).
XmlNodeList tempNodeList = base.GetElementsByTagName(name);
- int tempint = tempNodeList.Count;
+ _ = tempNodeList.Count;
return tempNodeList;
}
Debug.Assert(buffer == null || bytesOrCharsLength <= (buffer.Length - bufferIndex), "Not enough space in user's buffer");
int totalBytesOrCharsRead = 0;
- string originalMethodName = isCharsBuffer ? "GetChars" : "GetBytes";
// we need length in bytes, b/c that is what SQLGetData expects
long cbLength = (isCharsBuffer) ? checked(bytesOrCharsLength * 2) : bytesOrCharsLength;
// Disconnect happens in OdbcConnectionHandle.ReleaseHandle
case ODBC32.SQL_HANDLE.ENV:
case ODBC32.SQL_HANDLE.STMT:
- ODBC32.RetCode retcode = Interop.Odbc.SQLFreeHandle(handleType, handle);
+ Interop.Odbc.SQLFreeHandle(handleType, handle);
break;
case ODBC32.SQL_HANDLE.DESC:
if (functionAddr == IntPtr.Zero)
{
- int hResult = Marshal.GetLastWin32Error();
throw CreateLocalDBException(errorMessage: SR.LocalDB_MethodNotFound);
}
s_localDBFormatMessage = Marshal.GetDelegateForFunctionPointer<LocalDBFormatMessageDelegate>(functionAddr);
private void WaitForAsyncResults(IAsyncResult asyncResult)
{
- Task completionTask = (Task)asyncResult;
if (!asyncResult.IsCompleted)
{
asyncResult.AsyncWaitHandle.WaitOne();
{
get
{
- string result = _accessToken;
// When a connection is connecting or is ever opened, make AccessToken available only if "Persist Security Info" is set to true
// otherwise, return null
SqlConnectionString connectionOptions = (SqlConnectionString)UserConnectionOptions;
if (retryTask.IsFaulted)
{
- Exception e = retryTask.Exception.InnerException;
_parent.CloseInnerConnection();
_parent._currentCompletion = null;
_result.SetException(retryTask.Exception.InnerException);
{
if (cmd != null)
{
- SqlConnection connection = cmd.Connection;
-
if (cmd.Notification != null)
{
// Fail if cmd has notification that is not already associated with this dependency.
// Always use ConnectionStringBuilder since in default case it is different from the
// connection string used in the hashHelper.
_con = new SqlConnection(_hashHelper.ConnectionStringBuilder.ConnectionString); // Create connection and open.
-
- // Assert permission for this particular connection string since it differs from the user passed string
- // which we have already demanded upon.
- SqlConnectionString connStringObj = (SqlConnectionString)_con.ConnectionOptions;
-
_con.Open();
_cachedServer = _con.DataSource;
internal void IncrementStartCount(string appDomainKey, out bool appDomainStart)
{
appDomainStart = false; // Reset out param.
- int result = Interlocked.Increment(ref _startCount); // Add to refCount.
+ Interlocked.Increment(ref _startCount); // Add to refCount.
// Dictionary used to track how many times start has been called per app domain.
// For each increment, add to count, and create entry if not present.
{
using (XmlReader xmlReader = xmlMessage.CreateReader())
{
- string keyvalue = string.Empty;
-
MessageAttributes messageAttributes = MessageAttributes.None;
SqlNotificationType type = SqlNotificationType.Unknown;
payloadLength = payload[offset++] << 8 | payload[offset++];
byte majorVersion = payload[payloadOffset];
- byte minorVersion = payload[payloadOffset + 1];
- int level = (payload[payloadOffset + 2] << 8) |
- payload[payloadOffset + 3];
-
isYukonOrLater = majorVersion >= 9;
if (!isYukonOrLater)
{
/// </summary>
public FilterAndTransform(string filterAndPayloadSpec, int startIdx, int endIdx, DiagnosticSourceEventSource eventSource, FilterAndTransform next)
{
-#if DEBUG
- string spec = filterAndPayloadSpec.Substring(startIdx, endIdx - startIdx);
-#endif
+ Debug.Assert(filterAndPayloadSpec != null && startIdx >= 0 && startIdx <= endIdx && endIdx <= filterAndPayloadSpec.Length);
Next = next;
_eventSource = eventSource;
TypeInfo curTypeInfo = type.GetTypeInfo();
foreach (PropertyInfo property in curTypeInfo.DeclaredProperties)
{
- Type propertyType = property.PropertyType;
newSerializableArgs = new TransformSpec(property.Name, 0, property.Name.Length, newSerializableArgs);
}
return Reverse(newSerializableArgs);
/// </summary>
public TransformSpec(string transformSpec, int startIdx, int endIdx, TransformSpec next = null)
{
- Debug.Assert(transformSpec != null && startIdx < endIdx);
-#if DEBUG
- string spec = transformSpec.Substring(startIdx, endIdx - startIdx);
-#endif
+ Debug.Assert(transformSpec != null && startIdx >= 0 && startIdx < endIdx && endIdx <= transformSpec.Length);
Next = next;
// Pick off the Var=
{
get
{
- string currentMachineName = this.machineName;
-
if (entriesCollection == null)
entriesCollection = new EventLogEntryCollection(this);
return entriesCollection;
{
get
{
- string currentMachineName = this.machineName;
return boolFlags[Flag_monitoring];
}
set
{
get
{
- string currentMachineName = this.machineName;
if (this.synchronizingObject == null && parent.ComponentDesignMode)
{
IDesignerHost host = (IDesignerHost)parent.ComponentGetService(typeof(IDesignerHost));
{
get
{
- string currentMachineName = this.machineName;
return sourceName;
}
}
{
add
{
- string currentMachineName = this.machineName;
onEntryWrittenHandler += value;
}
remove
{
- string currentMachineName = this.machineName;
onEntryWrittenHandler -= value;
}
}
object objectID = key.GetValue("First Counter");
if (objectID != null)
{
- int firstID = (int)objectID;
lock (table)
{
table[category] = categoryType;
{
if (_counterSet._provider != null)
{
- uint Status = Interop.PerfCounter.PerfDeleteInstance(_counterSet._provider._hProvider, _nativeInst);
+ Interop.PerfCounter.PerfDeleteInstance(_counterSet._provider._hProvider, _nativeInst);
}
_nativeInst = null;
}
}
else if (exception is LdapException ldapException)
{
- LdapError errorCode = (LdapError)ldapException.ErrorCode;
-
if (asyncResult._response != null)
{
// add previous retrieved entries if available
int count = 0;
ArrayList unmanagedTrustList = new ArrayList();
ArrayList tmpTrustList = new ArrayList();
- TrustRelationshipInformationCollection collection = new TrustRelationshipInformationCollection();
int localDomainIndex = 0;
string localDomainParent = null;
int error = 0;
try
{
int totalWritten = 0;
- Memory<byte> source = Memory<byte>.Empty;
OperationStatus lastResult = OperationStatus.DestinationTooSmall;
// We want to continue calling Decompress until we're either out of space for output or until Decompress indicates it is finished.
while (buffer.Length > 0 && lastResult != OperationStatus.Done)
{
HttpRequestMessage request = state.RequestMessage;
SafeWinHttpHandle requestHandle = state.RequestHandle;
- CookieUsePolicy cookieUsePolicy = state.Handler.CookieUsePolicy;
- CookieContainer cookieContainer = state.Handler.CookieContainer;
var response = new HttpResponseMessage();
bool stripEncodingHeaders = false;
{
CancellationToken = cancellationToken;
var b = new AsyncTaskMethodBuilder();
- var ignored = b.Task; // force initialization
+ _ = b.Task; // force initialization
Builder = b;
}
}
TimeSpan pooledConnectionLifetime = _poolManager.Settings._pooledConnectionLifetime;
- TimeSpan pooledConnectionIdleTimeout = _poolManager.Settings._pooledConnectionIdleTimeout;
long nowTicks = Environment.TickCount64;
List<CachedConnection> list = _idleConnections;
NetEventSource.DumpBuffer(this, buffer.Array, buffer.Offset, buffer.Count);
}
- int position = buffer.Offset;
-
EnsureSendOperation();
_sendOperation.BufferType = GetBufferType(messageType, endOfMessage);
await _sendOperation.Process(buffer, linkedCancellationToken).SuppressContextFlow();
{
responsibleForReturningToPool = _accessed;
_accessed = true;
- var ignored = _builder.Task; // force initialization under the lock (builder itself lazily initializes w/o synchronization)
+ _ = _builder.Task; // force initialization under the lock (builder itself lazily initializes w/o synchronization)
return _builder;
}
}
{
// The Async IO completed with a failure.
// here we need to call WSAGetOverlappedResult() just so GetLastSocketError() will return the correct error.
- bool success = Interop.Winsock.WSAGetOverlappedResult(
+ Interop.Winsock.WSAGetOverlappedResult(
_currentSocket.SafeHandle,
nativeOverlapped,
out numBytes,
// be used to get the response, and it needs to be passed the IAsyncResult that was returned
// from WebRequest.BeginGetResponse.
var awaitable = new BeginEndAwaitableAdapter();
- IAsyncResult iar = request.BeginGetResponse(BeginEndAwaitableAdapter.Callback, awaitable);
+ request.BeginGetResponse(BeginEndAwaitableAdapter.Callback, awaitable);
return GetWebResponse(request, await awaitable);
}
context.IncrementItemCount(memberCount);
DataMember[] members = new DataMember[memberCount];
- int reflectedMemberCount = ReflectionGetMembers(classContract, members);
+ ReflectionGetMembers(classContract, members);
int memberIndex = -1;
Type valueType = keyValueTypes[1];
int keyTypeNullableDepth = 0;
- Type keyTypeOriginal = keyType;
while (keyType.IsGenericType && keyType.GetGenericTypeDefinition() == Globals.TypeOfNullable)
{
keyTypeNullableDepth++;
childElementIndex += memberCount;
- Type classType = classContract.UnadaptedClassType;
context.IncrementItemCount(classContract.Members.Count);
for (int i = 0; i < classContract.Members.Count; i++, memberCount++)
{
bool isArray = (collectionContract.Kind == CollectionKind.Array);
int arraySize = context.GetArraySize();
- string objectId = context.GetObjectId();
object resultArray = null;
if (isArray && ReflectionTryReadPrimitiveArray(xmlReader, context, collectionItemName, collectionItemNamespace, collectionContract.UnderlyingType, collectionContract.ItemType, arraySize, out resultArray))
{
DataMember dataMember = members[memberIndex];
Debug.Assert(dataMember != null);
- Type memberType = dataMember.MemberType;
if (dataMember.IsGetOnlyCollection)
{
var memberValue = ReflectionGetMemberValue(obj, dataMember);
}
PrimitiveDataContract primitiveContract = PrimitiveDataContract.GetPrimitiveDataContract(type);
- bool hasValidPrimitiveContract = primitiveContract != null && primitiveContract.UnderlyingType != Globals.TypeOfObject;
if ((primitiveContract != null && primitiveContract.UnderlyingType != Globals.TypeOfObject) || nullables != 0 || type.IsValueType)
{
return (xmlReaderArg, contextArg, collectionContract, typeArg, nameArg, nsArg) =>
childElementIndex += memberCount;
- Type classType = classContract.UnadaptedClassType;
XmlDictionaryString[] memberNames = classContract.MemberNames;
XmlDictionaryString ns = classContract.Namespace;
context.IncrementItemCount(classContract.Members.Count);
if (name.Length > 4)
{
// Right now we don't support adding fabricated indexers on types
- string prefix = name.Substring(0, 4);
getPropertyGetter = (types == null || types.Length == 0) && name.StartsWith("get_", comparison);
if (!getPropertyGetter)
builder.WriteInt32(age);
// UTF-8 encoded zero-terminated path to PDB
- int pathStart = builder.Count;
builder.WriteUTF8(pdbPath, allowUnpairedSurrogates: true);
builder.WriteByte(0);
//
internal RoPseudoCustomAttributeData(ConstructorInfo constructor, Func<CustomAttributeArguments> argumentsPromise)
{
- CustomAttributeArguments ca = argumentsPromise();
-
_constructor = constructor;
_argumentsPromise = argumentsPromise;
}
protected sealed override RoType ComputeDeclaringType()
{
- MetadataReader reader = Reader;
TypeDefinitionHandle declaringTypeHandle = (TypeDefinitionHandle)(GenericParameter.Parent);
EcmaDefinitionType declaringType = declaringTypeHandle.ResolveTypeDef(GetEcmaModule());
return declaringType;
int uniquifier = 0;
RoType systemInt32 = Loader.GetCoreType(CoreType.Int32);
- RoArrayType arrayType = this;
RoType elementType = GetRoElementType();
RoType systemVoid = Loader.GetCoreType(CoreType.Void);
if (value._sign < 0)
{
string negativeSign = info.NegativeSign;
- for (int i = info.NegativeSign.Length - 1; i > -1; i--)
- rgch[--ichDst] = info.NegativeSign[i];
+ for (int i = negativeSign.Length - 1; i > -1; i--)
+ rgch[--ichDst] = negativeSign[i];
}
int resultLength = cchMax - ichDst;
Span<byte> tag,
ReadOnlySpan<byte> associatedData = default)
{
- ref byte nullRef = ref MemoryMarshal.GetReference(Span<byte>.Empty);
-
using (SafeEvpCipherCtxHandle ctx = Interop.Crypto.EvpCipherCreatePartial(GetCipher(_key.Length * 8)))
{
Interop.Crypto.CheckValidOpenSslHandle(ctx);
if (value == null)
throw new ArgumentNullException(nameof(value));
- XmlElement retrievalMethodElement = value;
_uri = Utils.GetAttribute(value, "URI", SignedXml.XmlDsigNamespaceUrl);
_type = Utils.GetAttribute(value, "Type", SignedXml.XmlDsigNamespaceUrl);
}
IdentityReferenceCollection groups = new IdentityReferenceCollection();
using (SafeLocalAllocHandle pGroups = GetTokenInformation(_safeTokenHandle, TokenInformationClass.TokenGroups))
{
- uint groupCount = pGroups.Read<uint>(0);
-
Interop.TOKEN_GROUPS tokenGroups = pGroups.Read<Interop.TOKEN_GROUPS>(0);
Interop.SID_AND_ATTRIBUTES[] groupDetails = new Interop.SID_AND_ATTRIBUTES[tokenGroups.GroupCount];
pGroups.ReadArray((uint)Marshal.OffsetOf<Interop.TOKEN_GROUPS>("Groups").ToInt32(),
int leftOver = _buffer.Length - idx;
int leftOverFromConsumed = _buffer.Length - _consumed;
- long prevTotalConsumed = _totalConsumed;
long prevLineBytePosition = _bytePositionInLine;
long prevLineNumber = _lineNumber;
#else
Debug.Assert(_arrayBufferWriter.WrittenMemory.Length == _arrayBufferWriter.WrittenCount);
bool result = MemoryMarshal.TryGetArray(_arrayBufferWriter.WrittenMemory, out ArraySegment<byte> underlyingBuffer);
+ Debug.Assert(result);
Debug.Assert(underlyingBuffer.Offset == 0);
Debug.Assert(_arrayBufferWriter.WrittenCount == underlyingBuffer.Count);
_stream.Write(underlyingBuffer.Array, underlyingBuffer.Offset, underlyingBuffer.Count);
#else
Debug.Assert(_arrayBufferWriter.WrittenMemory.Length == _arrayBufferWriter.WrittenCount);
bool result = MemoryMarshal.TryGetArray(_arrayBufferWriter.WrittenMemory, out ArraySegment<byte> underlyingBuffer);
+ Debug.Assert(result);
Debug.Assert(underlyingBuffer.Offset == 0);
Debug.Assert(_arrayBufferWriter.WrittenCount == underlyingBuffer.Count);
await _stream.WriteAsync(underlyingBuffer.Array, underlyingBuffer.Offset, underlyingBuffer.Count, cancellationToken).ConfigureAwait(false);
#else
Debug.Assert(_arrayBufferWriter.WrittenMemory.Length == _arrayBufferWriter.WrittenCount);
bool result = MemoryMarshal.TryGetArray(_arrayBufferWriter.WrittenMemory, out ArraySegment<byte> underlyingBuffer);
+ Debug.Assert(result);
Debug.Assert(underlyingBuffer.Offset == 0);
Debug.Assert(_arrayBufferWriter.WrittenCount == underlyingBuffer.Count);
_stream.Write(underlyingBuffer.Array, underlyingBuffer.Offset, underlyingBuffer.Count);
*/
private void GenerateMiddleSection()
{
- Label l1 = DefineLabel();
Label[] table;
int i;
Label lAdvance = DefineLabel();
Label lFail = DefineLabel();
Label lStart = DefineLabel();
- Label lOutOfRange = DefineLabel();
Label lPartialMatch = DefineLabel();
else
{
LocalBuilder cV = _temp2V;
- LocalBuilder chV = _tempV;
Label l1 = DefineLabel();
Label l2 = DefineLabel();
Label l3 = DefineLabel();
LocalBuilder count = _tempV;
LocalBuilder mark = _temp2V;
Label l1 = DefineLabel();
- Label l2 = DefineLabel();
- Label l3 = _labels[NextCodepos()];
PopStack();
Stloc(count); // count -> temp
{
// The channel is full, and we're in a dropping mode.
// Drop either the oldest or the newest and write the new item.
- T droppedItem = parent._mode == BoundedChannelFullMode.DropNewest ?
- parent._items.DequeueTail() :
+ if (parent._mode == BoundedChannelFullMode.DropNewest)
+ {
+ parent._items.DequeueTail();
+ }
+ else
+ {
parent._items.DequeueHead();
+ }
parent._items.EnqueueTail(item);
return true;
}
{
// The channel is full, and we're in a dropping mode.
// Drop either the oldest or the newest and write the new item.
- T droppedItem = parent._mode == BoundedChannelFullMode.DropNewest ?
- parent._items.DequeueTail() :
+ if (parent._mode == BoundedChannelFullMode.DropNewest)
+ {
+ parent._items.DequeueTail();
+ }
+ else
+ {
parent._items.DequeueHead();
+ }
parent._items.EnqueueTail(item);
return default;
}
_actionCallerID = Environment.CurrentManagedThreadId;
if (_ownerThreadContext != null)
{
- var currentContext = _ownerThreadContext;
-
ContextCallback? handler = s_invokePostPhaseAction;
if (handler == null)
{