oops hash codes can be negative, account for that
From: Sean Dague <sdague@gmail.com>0.6.3-post-fixes
parent
c81395593d
commit
280ba00c68
|
@ -123,7 +123,8 @@ namespace OpenSim.Framework.Console
|
||||||
|
|
||||||
private static ConsoleColor DeriveColor(string input)
|
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)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue