04.07.2018, 10:34
how do I optimize this code to reduce lines and makes more understandable?
PHP код:
if(GetVehicleEngineType(modelid) == 'H')
{
format(typestr, 16, "Human Powered");
}
else if(GetVehicleEngineType(modelid) == 'D')
{
format(typestr, 16, "Diesel");
}
else if(GetVehicleEngineType(modelid) == 'P')
{
format(typestr, 16, "Petrol");
}
else if(GetVehicleEngineType(modelid) == 'E')
{
format(typestr, 16, "Electric");
}