[Tkabber-dev] r1321 - in trunk/tkabber: . plugins/chat

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Wed Nov 28 15:53:17 MSK 2007


Author: sergei
Date: 2007-11-28 15:52:51 +0300 (Wed, 28 Nov 2007)
New Revision: 1321

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/plugins/chat/nick_colors.tcl
Log:
	* plugins/chat/nick_colors.tcl: Replaced crc16 by sum for performance
	  reason and because crc16 fails to load in older Tcllib versions
	  (observed in Gentoo and Tcllib 1.6.1).


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2007-11-25 11:23:37 UTC (rev 1320)
+++ trunk/tkabber/ChangeLog	2007-11-28 12:52:51 UTC (rev 1321)
@@ -1,3 +1,9 @@
+2007-11-28  Sergei Golovan  <sgolovan at nes.ru>
+
+	* plugins/chat/nick_colors.tcl: Replaced crc16 by sum for performance
+	  reason and because crc16 fails to load in older Tcllib versions
+	  (observed in Gentoo and Tcllib 1.6.1).
+
 2007-11-25  Sergei Golovan  <sgolovan at nes.ru>
 
 	* chats.tcl, plugins/chat/nick_colors.tcl: Implemented storing and

Modified: trunk/tkabber/plugins/chat/nick_colors.tcl
===================================================================
--- trunk/tkabber/plugins/chat/nick_colors.tcl	2007-11-25 11:23:37 UTC (rev 1320)
+++ trunk/tkabber/plugins/chat/nick_colors.tcl	2007-11-28 12:52:51 UTC (rev 1321)
@@ -5,7 +5,7 @@
 #
 # $Id$
 
-package require crc16
+package require sum
 
 namespace eval nickcolors {
 
@@ -112,7 +112,7 @@
     if {[info exists NickColors($nick)]} {
 	return $NickColors($nick)
     } else {
-	set index [expr {[crc::crc16 $nick] % [llength $NickColorPool]}]
+	set index [expr {[crc::sum -- $nick] % [llength $NickColorPool]}]
 	return [lindex $NickColorPool $index]
     }
 }



More information about the Tkabber-dev mailing list