mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
oops hash codes can be negative, account for that
From: Sean Dague <sdague@gmail.com>
This commit is contained in:
@@ -123,7 +123,8 @@ namespace OpenSim.Framework.Console
|
||||
|
||||
private static ConsoleColor DeriveColor(string input)
|
||||
{
|
||||
return Colors[(input.ToUpper().GetHashCode() % Colors.Length)];
|
||||
// it is important to do Abs, hash values can be negative
|
||||
return Colors[(Math.Abs(input.ToUpper().GetHashCode()) % Colors.Length)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user