Code cleanup in the Microsoft.CodeAnalysis project - #1232
Conversation
d43a214 to
57ef315
Compare
There was a problem hiding this comment.
This assignment is actually redundant: TryGetValue sets its out parameter to null if it returns false. I would like to remove the assignment and if completely. But I'm not sure if it would be unanimously accepted.
There was a problem hiding this comment.
It's reasonable to remove the assignment and if. There are many examples of that in the code.
There was a problem hiding this comment.
I checked the specification of TryGetValue and that behavior is guaranteed.
There was a problem hiding this comment.
Ok. I'm going to remove the if.
c467a1a to
df9f0f4
Compare
|
💡 It might seem counter-intuitive, but it would have been helpful if this (or future requests of a related nature) was submitted as separate pull requests for each specific type of change (yes that means ~2 dozen pull requests). When it comes to external reviewers that may or may not have time to look at the entire diff, sometimes people will want to focus their examination on particular topic of most interest to them, and it becomes very time consuming when everything is submitted together. |
There was a problem hiding this comment.
❓ This is only a partial conversion to a documentation comment. Did you mean to convert the internal structure to its XML form as well?
There was a problem hiding this comment.
@sharwell Unfortunately, we have many doc comments that use indentation for formatting, that is only useful when you are looking at the source, but not preserved in the generated documentation or tooltips. We will consider fixing all of them as a separate effort later.
There was a problem hiding this comment.
Unobservable increment.
|
This pull request has become much too large to review, and keeps changing out from under my attempt to review it. In the future can you please do separate refactorings seprately? |
|
@gafter I will try to keep PR sizes more manageable. I think this one is in its final form, unless there will be a strong feedback requesting to change something. |
|
@VladimirReshetnikov Could we wait with this after RC is snapped? |
|
@tmat Sure. It means 3/17/2015 after noon? |
|
@VladimirReshetnikov Should be. I'll be kicking off the signed build and can update you once I have done so. |
|
@tmat @tannergooding Is it safe to merge now? |
|
Yes |
Code cleanup in the Microsoft.CodeAnalysis project
* Update Microsoft.IO.Redist * Update MessagePack * Update System.Text.Json * Update Newtonsoft.Json * Update Microsoft.Build.Tasks.Core * Update Microsoft.Build.Tasks.Core (part 2) * Convert some constants to variables (fixups) * Accept code review feedback * Remove ExcludeAssets="all" from unittest projects under samples for Newtonsoft.Json
Code cleanup in the
Microsoft.CodeAnalysisproject:?.where it simplifies code; replace conditional freeing or disposal usingifto?.syntaxnameof(...)instead of string literals in exception; fixed several wrong parameter names and misused exceptions; fixed expected exceptions in tests? :expressions in terms of simpler&&expressionsusingdirectives(uint)expr >= 0seq.Where(...).FirstOrDefault()toseq.FirstOrDefault(...)readonlywhere possiblestaticwhere possibleunsafemodifiersis/cast combinations withas/null-check<see>and<paramref>to some XML doc comments; remove empty elementscaselabels adjacent todefaultlabels inswitchstatements; remove redundantdefault: break;sectionsifs to ternary operators[StructLayout(LayoutKind.Auto)]for some structs=>body in some properties