aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
authorJeff Ames2007-12-19 08:44:25 +0000
committerJeff Ames2007-12-19 08:44:25 +0000
commit6702b0373371fd2a546a580ad82f5cc175fa29e0 (patch)
treef2750d5be494d2a976cb583476c4f32ef3d895d7 /OpenSim/Framework/Util.cs
parent*Added Ban Lines around parcels for banned avatars, but there is no actual bl... (diff)
downloadopensim-SC_OLD-6702b0373371fd2a546a580ad82f5cc175fa29e0.zip
opensim-SC_OLD-6702b0373371fd2a546a580ad82f5cc175fa29e0.tar.gz
opensim-SC_OLD-6702b0373371fd2a546a580ad82f5cc175fa29e0.tar.bz2
opensim-SC_OLD-6702b0373371fd2a546a580ad82f5cc175fa29e0.tar.xz
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
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Util.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index a8eef51..740f527 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -373,5 +373,15 @@ namespace OpenSim.Framework
373 config.Configs[(string) row[0]].Set(row.Table.Columns[i].ColumnName, row[i]); 373 config.Configs[(string) row[0]].Set(row.Table.Columns[i].ColumnName, row[i]);
374 } 374 }
375 } 375 }
376
377 public static float Clip(float x, float min, float max)
378 {
379 return Math.Min(Math.Max(x, min), max);
380 }
381
382 public static int Clip(int x, int min, int max)
383 {
384 return Math.Min(Math.Max(x, min), max);
385 }
376 } 386 }
377} 387}