From 280ba00c68fb950e4c6e05747ff3ab4f7e4fd401 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 19 Jan 2009 21:38:31 +0000 Subject: [PATCH] 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(-) diff --git a/OpenSim/Framework/Console/OpenSimAppender.cs b/OpenSim/Framework/Console/OpenSimAppender.cs index 5abbbdc270..0246b39b1e 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)]; } } }