Misc. cleanup:

* added Util.Clip(value, min, max)
* modified asset cache's numPackets calculation to use max packet size (600) instead of 1000
* removed a few magic numbers
This commit is contained in:
Jeff Ames
2007-12-19 08:44:25 +00:00
parent bd16dddce5
commit 6702b03733
16 changed files with 136 additions and 155 deletions

View File

@@ -373,5 +373,15 @@ namespace OpenSim.Framework
config.Configs[(string) row[0]].Set(row.Table.Columns[i].ColumnName, row[i]);
}
}
public static float Clip(float x, float min, float max)
{
return Math.Min(Math.Max(x, min), max);
}
public static int Clip(int x, int min, int max)
{
return Math.Min(Math.Max(x, min), max);
}
}
}