Skip to content

Commit bedc8d5

Browse files
authored
Simplify Convert (#33659)
* Simplify Convert * Optimize Number.UInt32ToDecStr
1 parent 6059512 commit bedc8d5

File tree

10 files changed

+88
-107
lines changed

10 files changed

+88
-107
lines changed

src/libraries/System.Private.CoreLib/src/System/Byte.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ private static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, NumberFor
166166

167167
public override string ToString()
168168
{
169-
return Number.UInt32ToDecStr(m_value, -1);
169+
return Number.UInt32ToDecStr(m_value);
170170
}
171171

172172
public string ToString(string? format)
@@ -176,7 +176,7 @@ public string ToString(string? format)
176176

177177
public string ToString(IFormatProvider? provider)
178178
{
179-
return Number.FormatUInt32(m_value, null, provider);
179+
return Number.UInt32ToDecStr(m_value);
180180
}
181181

182182
public string ToString(string? format, IFormatProvider? provider)

0 commit comments

Comments
 (0)