do while (true); // Getting rid of warnings / Alternative?
#1

pawn Код:
public FindSkin(gender, skin, price){
    new skinid;
    do
    {
        skinid = random(300);
        if(  SkinDB[skinid][Gender] == gender && SkinDB[skinid][Skin] == skin && SkinDB[skinid][Price] == price ) break;
    }
    while( true ); // warning 206: redundant test: constant expression is non-zero
    return skinid; // warning 225: unreachable code
}
Now, this code functions like it should, and does what needed. However, it puts out two warnings, stated in the code as comments. What is the best way to get rid of them. Or what would be a better, more optimal way to do this?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)