@@ -13,8 +13,7 @@ public partial record CSharpCodeBuilder
1313 /// <returns>The current <see cref="CSharpCodeBuilder"/> instance to allow for method chaining.</returns>
1414 /// <remarks>Appends either "true" or "false" based on the value if the condition is true.</remarks>
1515 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
16- public CSharpCodeBuilder AppendIf ( bool condition , bool value ) =>
17- condition ? Append ( value ) : this ;
16+ public CSharpCodeBuilder AppendIf ( bool condition , bool value ) => condition ? Append ( value ) : this ;
1817
1918 /// <summary>
2019 /// Appends a character repeated a specified number of times to the current builder if the specified condition is true.
@@ -35,8 +34,7 @@ public CSharpCodeBuilder AppendIf(bool condition, char value, int repeatCount) =
3534 /// <param name="value">The character to append.</param>
3635 /// <returns>The current <see cref="CSharpCodeBuilder"/> instance to allow for method chaining.</returns>
3736 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
38- public CSharpCodeBuilder AppendIf ( bool condition , char value ) =>
39- condition ? Append ( value ) : this ;
37+ public CSharpCodeBuilder AppendIf ( bool condition , char value ) => condition ? Append ( value ) : this ;
4038
4139 /// <summary>
4240 /// Appends a subset of an array of characters to the current builder if the specified condition is true.
@@ -48,12 +46,8 @@ public CSharpCodeBuilder AppendIf(bool condition, char value) =>
4846 /// <returns>The current <see cref="CSharpCodeBuilder"/> instance to allow for method chaining.</returns>
4947 /// <remarks>If the array is null or empty, the method returns without appending anything.</remarks>
5048 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
51- public CSharpCodeBuilder AppendIf (
52- bool condition ,
53- char [ ] ? value ,
54- int startIndex ,
55- int charCount
56- ) => condition ? Append ( value , startIndex , charCount ) : this ;
49+ public CSharpCodeBuilder AppendIf ( bool condition , char [ ] ? value , int startIndex , int charCount ) =>
50+ condition ? Append ( value , startIndex , charCount ) : this ;
5751
5852 /// <summary>
5953 /// Appends an array of characters to the current builder if the specified condition is true.
@@ -63,8 +57,7 @@ int charCount
6357 /// <returns>The current <see cref="CSharpCodeBuilder"/> instance to allow for method chaining.</returns>
6458 /// <remarks>If the array is null or empty, the method returns without appending anything.</remarks>
6559 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
66- public CSharpCodeBuilder AppendIf ( bool condition , char [ ] ? value ) =>
67- condition ? Append ( value ) : this ;
60+ public CSharpCodeBuilder AppendIf ( bool condition , char [ ] ? value ) => condition ? Append ( value ) : this ;
6861
6962 /// <summary>
7063 /// Appends characters from a pointer to the current builder if the specified condition is true.
@@ -86,8 +79,7 @@ public unsafe CSharpCodeBuilder AppendIf(bool condition, char* value, int length
8679 /// <returns>The current <see cref="CSharpCodeBuilder"/> instance to allow for method chaining.</returns>
8780 /// <remarks>If the memory is empty, the method returns without appending anything.</remarks>
8881 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
89- public CSharpCodeBuilder AppendIf ( bool condition , ReadOnlyMemory < char > value ) =>
90- condition ? Append ( value ) : this ;
82+ public CSharpCodeBuilder AppendIf ( bool condition , ReadOnlyMemory < char > value ) => condition ? Append ( value ) : this ;
9183
9284 /// <summary>
9385 /// Appends a subset of a read-only memory of characters to the current builder if the specified condition is true.
@@ -99,12 +91,8 @@ public CSharpCodeBuilder AppendIf(bool condition, ReadOnlyMemory<char> value) =>
9991 /// <returns>The current <see cref="CSharpCodeBuilder"/> instance to allow for method chaining.</returns>
10092 /// <remarks>If the memory is empty, the method returns without appending anything.</remarks>
10193 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
102- public CSharpCodeBuilder AppendIf (
103- bool condition ,
104- ReadOnlyMemory < char > value ,
105- int startIndex ,
106- int count
107- ) => condition ? Append ( value , startIndex , count ) : this ;
94+ public CSharpCodeBuilder AppendIf ( bool condition , ReadOnlyMemory < char > value , int startIndex , int count ) =>
95+ condition ? Append ( value , startIndex , count ) : this ;
10896
10997 /// <summary>
11098 /// Appends a subset of a string to the current builder if the specified condition is true.
@@ -127,6 +115,5 @@ public CSharpCodeBuilder AppendIf(bool condition, string? value, int startIndex,
127115 /// <returns>The current <see cref="CSharpCodeBuilder"/> instance to allow for method chaining.</returns>
128116 /// <remarks>If the string is null or empty, the method returns without appending anything.</remarks>
129117 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
130- public CSharpCodeBuilder AppendIf ( bool condition , string ? value ) =>
131- condition ? Append ( value ) : this ;
118+ public CSharpCodeBuilder AppendIf ( bool condition , string ? value ) => condition ? Append ( value ) : this ;
132119}
0 commit comments