Replies: 1 comment
-
In that case you want something along the lines of this.
You call the original method to get the return value and then return that as |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to replace this code:
this code is the original from metadata:
public static int GetZhuoyueAttributeCount(int excellenceInfo)
{
if (excellenceInfo [= 0)
{
return 0;
}
int num = 0;
int num2 = 32;
for (int i = 0; i [ num2; i++)
{
if (Global.GetIntSomeBit(excellenceInfo, i) == 1)
{
num++;
}
}
return num;
}
and I want just to change the return value from
return num; to
return Math.Min(6,num); so the code must be like this
public static int GetZhuoyueAttributeCount(int excellenceInfo)
{
if (excellenceInfo [= 0)
{
return 0;
}
int num = 0;
int num2 = 32;
for (int i = 0; i [ num2; i++)
{
if (Global.GetIntSomeBit(excellenceInfo, i) == 1)
{
num++;
}
}
return Math.Min(6, num);
}
Beta Was this translation helpful? Give feedback.
All reactions