jitwxs / 163MusicLyrics

Windows 云音乐歌词获取【网易云、QQ音乐】
Apache License 2.0
2.03k stars 107 forks source link

[Bug修复] toInt函数 重命名为 ToInt & 使 ToInt 函数按预期工作 #184

Closed textGamex closed 7 months ago

textGamex commented 1 year ago

在原来的 toInt 实现中:

public static int toInt(string str, int defaultValue)
{
    var result = defaultValue;

    int.TryParse(str, out result);

    return result;
}

无论 defaultValue 为什么值, 当解析失败时, result 的值都会被覆盖为 0, 虽然在代码中参数 defaultValue 全是 0, 但这总归是一个 bug