Conversation
| culture: null); | ||
|
|
||
| return result != null ? (int)result : 0; | ||
| return (int?) result ?? 0; |
There was a problem hiding this comment.
These are not the same; the latter produces IL that involves nullable. Please revert this and all similar changes.
|
|
||
| IEqualityComparer<TKey>? comparer = _comparer; | ||
| uint hashCode = (uint)((comparer == null) ? key.GetHashCode() : comparer.GetHashCode(key)); | ||
| uint hashCode = (uint)(comparer?.GetHashCode(key) ?? key.GetHashCode()); |
There was a problem hiding this comment.
I don't think this is an improvement. The previous code was easy to understand: if comparer is null, do one thing, otherwise do something else. This takes longer to visually parse and understand. Please revert this.
| } | ||
| } // class Convert | ||
| } // namespace | ||
| } // namespace No newline at end of file |
| m_creator = creator; | ||
| m_uniqueId = uniqueId; | ||
| m_level = creator != null ? creator.m_level + 1 : 0; | ||
| m_level = creator?.m_level + 1 ?? 0; |
There was a problem hiding this comment.
This is hard to understand. Please revert.
| { | ||
| ManifestBuilder? manifest = null; | ||
| bool bNeedsManifest = source != null ? !source.SelfDescribingEvents : true; | ||
| bool bNeedsManifest = !source?.SelfDescribingEvents ?? true; |
There was a problem hiding this comment.
This is harder to understand. Please revert.
| public void AddBinary(string? value) | ||
| { | ||
| DataCollector.ThreadInstance.AddBinary(value, value == null ? 0 : value.Length * 2); | ||
| DataCollector.ThreadInstance.AddBinary(value, value?.Length * 2 ?? 0); |
There was a problem hiding this comment.
This is harder to understand. Please revert.
| return Compare(string1, offset1, string1 == null ? 0 : string1.Length - offset1, | ||
| string2, offset2, string2 == null ? 0 : string2.Length - offset2, options); | ||
| return Compare(string1, offset1, string1?.Length - offset1 ?? 0, | ||
| string2, offset2, string2?.Length - offset2 ?? 0, options); |
There was a problem hiding this comment.
These are harder to understand. Please revert.
| public void Add<T>(T value, IEqualityComparer<T>? comparer) | ||
| { | ||
| Add(comparer != null ? comparer.GetHashCode(value) : (value?.GetHashCode() ?? 0)); | ||
| Add(comparer?.GetHashCode(value) ?? (value?.GetHashCode() ?? 0)); |
There was a problem hiding this comment.
This is harder to understand. Please revert.
| else | ||
| { | ||
| char ch = builder[builder.Length - 1]; | ||
| char ch = builder[^1]; |
There was a problem hiding this comment.
Please revert all use of ^1 in this file. This file ends up getting compiled into some downlevel assemblies that do not have access to Index.
| else | ||
| { | ||
| if (!PathInternal.IsDirectorySeparator(builder[builder.Length - 1]) && !PathInternal.IsDirectorySeparator(path[0])) | ||
| if (!(PathInternal.IsDirectorySeparator(builder[^1]) || PathInternal.IsDirectorySeparator(path[0]))) |
| { | ||
| uint result = Interop.Kernel32.GetLongPathNameW( | ||
| ref inputBuilder.GetPinnableReference(terminate: true), ref outputBuilder.GetPinnableReference(), (uint)outputBuilder.Capacity); | ||
| ref inputBuilder.GetPinnableReference(terminate: true), ref outputBuilder.GetPinnableReference(), |
| return false; | ||
|
|
||
| char c = path[path.Length - 1]; | ||
| char c = path[^1]; |
There was a problem hiding this comment.
Please revert this file. Same reason as earlier.
| if (!hasValue) return other == null; | ||
| if (other == null) return false; | ||
| return value.Equals(other); | ||
| return !hasValue ? other == null : other != null && value.Equals(other); |
There was a problem hiding this comment.
This is harder to understand. Please revert this.
| return source != null ? | ||
| source.InternalRegister(callback, state, useSynchronizationContext ? SynchronizationContext.Current : null, useExecutionContext ? ExecutionContext.Capture() : null) : | ||
| default; // Nothing to do for tokens than can never reach the canceled state. Give back a dummy registration. | ||
| return source?.InternalRegister(callback, state, useSynchronizationContext ? SynchronizationContext.Current : null, useExecutionContext ? ExecutionContext.Capture() : null) ?? default; // Nothing to do for tokens than can never reach the canceled state. Give back a dummy registration. |
There was a problem hiding this comment.
Please put the default and everything after it back on its own line. This new formatting creates an incredibly long line.
| int len = threadsToPrint.Count; | ||
| Console.WriteLine("getting info for {0} threads", len); | ||
| for (int i = 0; i < len; i++) | ||
| foreach (var t in threadsToPrint) |
There was a problem hiding this comment.
var => whatever type this actually is
|
I see the issue; I am not using the version of C# this program is meant to be in. I am going to undo my changes and redo them |
* adding ci legs to release 3.1 branch * removing regex and adding branches as regex was not working Remove unnecessary !s for [DoesNotReturn] (#26350) Remove unused test file introduced in #25948 (#26349) Fix BinaryReader.ReadChars for fragmented Streams (#26324) BinaryReader.ReadChars incorrectly read more than necessary from the underlying Stream when multi-byte characters straddled the read chunks. Fixes https://github.com/dotnet/corefx/issues/40455 Update ReadOnlyDictionary.cs Simplify null checks Update parse-hb-log.cs Update Nullable.cs Optimizations Use Expression Update Update PathHelper.Windows.cs Fix convert Update Nullable.cs Update StackFrameHelper.cs Revert "Merge branch 'null-check' of https://github.com/pi1024e/coreclr into null-check" This reverts commit 67cef41, reversing changes made to deda7bb. Revert "Update PathHelper.Windows.cs" This reverts commit deda7bb. Revert "Update" This reverts commit add7e53. Revert "Use Expression" This reverts commit 96d11b4. Revert "Revert "Use Expression"" This reverts commit e710c78. Revert "Revert "Revert "Use Expression""" This reverts commit d12cef3. Revert "Simplify null checks" This reverts commit df97df7. Revert "Update ReadOnlyDictionary.cs" This reverts commit b09e08e. Revert "Update" This reverts commit add7e53. Revert "Optimizations" This reverts commit a1f19e5. Update objectnative.cpp
All refactorings and code fixes were done by the IDE.