From 280ba00c68fb950e4c6e05747ff3ab4f7e4fd401 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 19 Jan 2009 21:38:31 +0000 Subject: oops hash codes can be negative, account for that From: Sean Dague --- OpenSim/Framework/Console/OpenSimAppender.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/Console') diff --git a/OpenSim/Framework/Console/OpenSimAppender.cs b/OpenSim/Framework/Console/OpenSimAppender.cs index 5abbbdc..0246b39 100644 --- a/OpenSim/Framework/Console/OpenSimAppender.cs +++ b/OpenSim/Framework/Console/OpenSimAppender.cs @@ -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)]; } } } -- cgit v1.1