Skip to content

Commit 23723b9

Browse files
authored
[StyleCleanUp] Use compound assignment (IDE0054) (#10620)
* [StyleCleanUp] Use compound assignment (IDE0054) * Removed redundant braces
1 parent b878966 commit 23723b9

File tree

71 files changed

+131
-133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+131
-133
lines changed

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Ink/InkSerializedFormat/SerializationHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public static uint SignDecode(Stream strm, out int i)
188188
if ((ull & 0x0001) > 0)
189189
fneg = true;
190190

191-
ull = ull >> 1;
191+
ull >>= 1;
192192

193193
long l = (long)ull;
194194

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Ink/StrokeNode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ internal Point GetPointAt(double findex)
10581058
// eg turn 2.75 into .75
10591059
//
10601060
double floor = Math.Floor(findex);
1061-
findex = findex - floor;
1061+
findex -= floor;
10621062

10631063
double xDiff = (_thisNode.Position.X - _lastNode.Position.X) * findex;
10641064
double yDiff = (_thisNode.Position.Y - _lastNode.Position.Y) * findex;

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Media/XamlSerializationHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ internal static double ReadDouble( BinaryReader reader )
349349
internal static double ReadScaledInteger(BinaryReader reader )
350350
{
351351
double value = (double) reader.ReadInt32();
352-
value = value * inverseScaleFactor ;
352+
value *= inverseScaleFactor ;
353353

354354
return value ;
355355
}

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Media3D/GeneralTransform2DTo3DTo2D.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ private List<HitTestEdge> GrabValidEdges(Point[] visualTexCoordBounds)
293293

294294
// in this case we have a non-indexed mesh
295295
int count = positions.Count;
296-
count = count - (count % 3);
296+
count -= (count % 3);
297297

298298
for (int i = 0; i < count; i+=3)
299299
{

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/Media3D/LineUtil.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,9 @@ internal static bool ComputeLineTriangleIntersection(
458458
double t = Vector3D.DotProduct(ref e2, ref q);
459459
double f = 1 / a;
460460

461-
t = t * f;
462-
u = u * f;
463-
v = v * f;
461+
t *= f;
462+
u *= f;
463+
v *= f;
464464

465465
hitCoord = new Point(u, v);
466466
dist = t;

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/Bidi.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2081,7 +2081,7 @@ out int cchResolved // number of char resolved
20812081
lastStrongClass = tempClass;
20822082
}
20832083

2084-
counter = counter + wordCount;
2084+
counter += wordCount;
20852085
}
20862086

20872087
if (counter < cchText) // couldn't optimize.

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/FormatSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ internal int GetFiniteFormatWidth(int paragraphWidth)
166166
// indent is part of our text line but not of LS line
167167
// paragraph width == 0 means format width is unlimited
168168
int formatWidth = (paragraphWidth <= 0 ? Constants.IdealInfiniteWidth : paragraphWidth);
169-
formatWidth = formatWidth - _pap.ParagraphIndent;
169+
formatWidth -= _pap.ParagraphIndent;
170170

171171
// sanitize the format width value before passing to LS
172172
formatWidth = Math.Max(formatWidth, 0);

src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal/TextFormatting/LineServicesCallbacks.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,7 @@ private Rect DrawTextDecoration(
13151315
);
13161316

13171317
// adjust the pen's thickness as it will be scaled back by the scale transform
1318-
drawingPenThickness = drawingPenThickness / Math.Abs(unitValue);
1318+
drawingPenThickness /= Math.Abs(unitValue);
13191319

13201320
// applied transforms
13211321
drawingContext.PushTransform(scaleTransform);

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Automation/Peers/AutomationPeer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,7 +2024,7 @@ internal void UpdateSubtree()
20242024
ContextLayoutManager lm = ContextLayoutManager.From(this.Dispatcher);
20252025
if(lm != null)
20262026
{
2027-
lm.AutomationSyncUpdateCounter = lm.AutomationSyncUpdateCounter + 1;
2027+
lm.AutomationSyncUpdateCounter += 1;
20282028

20292029
try
20302030
{
@@ -2107,7 +2107,7 @@ internal void UpdateSubtree()
21072107
}
21082108
finally
21092109
{
2110-
lm.AutomationSyncUpdateCounter = lm.AutomationSyncUpdateCounter - 1;
2110+
lm.AutomationSyncUpdateCounter -= 1;
21112111
}
21122112
}
21132113
}

src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Ink/Stroke.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -890,11 +890,11 @@ private Stroke Copy(StylusPointCollection sourceStylusPoints, double beginFIndex
890890
//
891891
if (!DoubleUtil.AreClose(beginFIndex, StrokeFIndices.BeforeFirst))
892892
{
893-
beginFIndex = beginFIndex - beginIndex;
893+
beginFIndex -= beginIndex;
894894
}
895895
if (!DoubleUtil.AreClose(endFIndex, StrokeFIndices.AfterLast))
896896
{
897-
endFIndex = endFIndex - beginIndex;
897+
endFIndex -= beginIndex;
898898
}
899899

900900
if (stylusPoints.Count > 1)

0 commit comments

Comments
 (0)