소스 검색

Update BT.Ban.tcl

solved issue regarding baning, issue with quicksort after 915 bans.
BLaCkShaDoW 3 년 전
부모
커밋
2dbde7b268
1개의 변경된 파일2개의 추가작업 그리고 11개의 파일을 삭제
  1. 2 11
      BlackTools/BT.Ban.tcl

+ 2 - 11
BlackTools/BT.Ban.tcl

@@ -72,17 +72,8 @@ foreach b $black(bans) {
 }
 
 ###
-#https://rosettacode.org/wiki/Sorting_algorithms/Quicksort#Tcl
 proc blacktools:quicksort {m} {
-    if {[llength $m] <= 1} {
-        return $m
-    }
-    set pivot [lindex $m 0]
-    set less [set equal [set greater [list]]]
-    foreach x $m {
-        lappend [expr {$x < $pivot ? "less" : $x > $pivot ? "greater" : "equal"}] $x
-    }
-    return [concat [blacktools:quicksort $less] $equal [blacktools:quicksort $greater]]
+	lsort -integer $m
 }
 
 ###
@@ -1227,4 +1218,4 @@ if {[validchan $chan]} {
 	set bhost "$newnick![getchanhost $newnick $chan]"
 	blacktools:auto:ban $newnick $bhost $chan ""
 	}
-}
+}