diff options
author | Sean Dague | 2009-01-19 21:38:31 +0000 |
---|---|---|
committer | Sean Dague | 2009-01-19 21:38:31 +0000 |
commit | 280ba00c68fb950e4c6e05747ff3ab4f7e4fd401 (patch) | |
tree | a0652670e23083318e88e25cd2c4712cf2a33e17 | |
parent | added display of exception (diff) | |
download | opensim-SC_OLD-280ba00c68fb950e4c6e05747ff3ab4f7e4fd401.zip opensim-SC_OLD-280ba00c68fb950e4c6e05747ff3ab4f7e4fd401.tar.gz opensim-SC_OLD-280ba00c68fb950e4c6e05747ff3ab4f7e4fd401.tar.bz2 opensim-SC_OLD-280ba00c68fb950e4c6e05747ff3ab4f7e4fd401.tar.xz |
oops hash codes can be negative, account for that
From: Sean Dague <sdague@gmail.com>
-rw-r--r-- | OpenSim/Framework/Console/OpenSimAppender.cs | 3 |
1 files changed, 2 insertions, 1 deletions
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 | |||
123 | 123 | ||
124 | private static ConsoleColor DeriveColor(string input) | 124 | private static ConsoleColor DeriveColor(string input) |
125 | { | 125 | { |
126 | return Colors[(input.ToUpper().GetHashCode() % Colors.Length)]; | 126 | // it is important to do Abs, hash values can be negative |
127 | return Colors[(Math.Abs(input.ToUpper().GetHashCode()) % Colors.Length)]; | ||
127 | } | 128 | } |
128 | } | 129 | } |
129 | } | 130 | } |