// Consider changing this:
try {
result = 100 / num;
}
catch (Exception e) {
result = 0;
}
// To this::
if (num != 0)
result = 100 / num;
else
result = 0;
' Consider changing this:
Try
result = 100 / num
Catch (e As Exception)
result = 0
End Try
// To this:
If Not (num = 0)
result = 100 / num
Else
result = 0
End If
// Consider changing this:
try {
result = 100 / num;
}
catch (e:Exception) {
result = 0;
}
// To this:
if (num != 0)
result = 100 / num;
else
result = 0;
|
请发表评论