The current implementation may cause _gcd() into an infinite loop if the parameter b is a unexpected value like string '0'. Which caused the video platform Bilibili its massive outage on 2021/7/13.
To prevent the condition makes the infinite loop, we have to make an explicit type conversion so that the b == 0 condition can be met when there's any undesired value.
Reference Issues
The current implementation may cause _gcd() into an infinite loop if the parameter b is a unexpected value like string '0'. Which caused the video platform Bilibili its massive outage on 2021/7/13.
Reference: https://mp.weixin.qq.com/s/zCOnUEp25xYqx7BMyrLIGQ
The change
To prevent the condition makes the infinite loop, we have to make an explicit type conversion so that the
b == 0
condition can be met when there's any undesired value.