Cleanup: instance-style extension calls, redundant generic args, and redundant casts#12583
Open
ivandrofly wants to merge 3 commits into
Open
Cleanup: instance-style extension calls, redundant generic args, and redundant casts#12583ivandrofly wants to merge 3 commits into
ivandrofly wants to merge 3 commits into
Conversation
The generic type is inferred from the source collection, so the explicit <string> is unnecessary noise. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Convert static extension-method invocations to instance call syntax: LINQ (Enumerable.FirstOrDefault/Count/ToList), ObservableCollectionExtensions.AddRange, ClipboardExtensions.TryGetTextAsync, UiUtil.RemoveControlFromParent, and SplitToLines. More readable and idiomatic; no behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop casts that the compiler already provides implicitly or that are no-ops: - redundant numeric casts around Math.Round / division / TimeSpan.FromSeconds where the operand or result type already matches (integer division semantics in AdvancedEffectAudioTextPulse are preserved); - pointless (uint)/(int)/(byte) casts on already-correct types; - (IEnumerable<T>) upcasts left over before LINQ instance calls; - superfluous nullable/reference casts on ternary branches (e.g. : (T?)null). No behavior change; full solution builds clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three small, behavior-preserving cleanup commits:
Drop redundant
<string>type argument fromMakeComboBoxcalls — the generic type is inferred from the source collection, so the explicit<string>was just noise. Touches the DCinema SMPTE, iTunes Timed Text, Timed Text 1.0, IMSC 1.1 property windows, and the Cut Video window.Use instance-style extension method calls — convert static extension-method invocations to instance call syntax: LINQ (
Enumerable.FirstOrDefault/Count/ToList),ObservableCollectionExtensions.AddRange,ClipboardExtensions.TryGetTextAsync,UiUtil.RemoveControlFromParent, andSplitToLines.Remove redundant and unnecessary casts — drop casts the compiler already supplies or that are no-ops: redundant numeric casts around
Math.Round/division/TimeSpan.FromSeconds(integer-division semantics preserved), pointless(uint)/(int)/(byte)casts on already-correct types, leftover(IEnumerable<T>)upcasts before LINQ instance calls, and superfluous nullable/reference casts on ternary branches.No behavior change. Full solution builds clean.
🤖 Generated with Claude Code