]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
Minor optimization to Auth.random_password
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sun, 18 Feb 2007 10:51:43 +0000 (10:51 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sun, 18 Feb 2007 10:51:43 +0000 (10:51 +0000)
lib/rbot/botuser.rb

index 4e35e5f3acd239f66c524450aa0ae461aa588aed..bed2b627cb59e9a36ea3a0ca1757f6771ecf88e8 100644 (file)
@@ -34,8 +34,8 @@ module Irc
     #\r
     def Auth.random_password(l=8)\r
       pwd = ""\r
-      8.times do\r
-        pwd += (rand(26) + (rand(2) == 0 ? 65 : 97) ).chr\r
+      l.times do\r
+        pwd << (rand(26) + (rand(2) == 0 ? 65 : 97) ).chr\r
       end\r
       return pwd\r
     end\r