Ver código fonte

Minor: remove hard-coded array length, simplify.

master
bgrozev 11 anos atrás
pai
commit
18e7aa50ab
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1
    1
      roomname_generator.js

+ 1
- 1
roomname_generator.js Ver arquivo

@@ -118,7 +118,7 @@ var RoomNameGenerator = function(my) {
118 118
      */
119 119
     function generateWord()
120 120
     {
121
-        return words[( Math.round(((new Date().getTime() / 1000) +Math.random()*1000) % 1008))];
121
+        return words[Math.floor(Math.random() * words.length)];
122 122
     }
123 123
 
124 124
     /**

Carregando…
Cancelar
Salvar