[Groonga-commit] groonga/gcs [master] Generate new id correctly

Back to archive index

null+****@clear***** null+****@clear*****
2012年 8月 9日 (木) 17:59:20 JST


SHIMODA Hiroshi	2012-08-09 17:59:20 +0900 (Thu, 09 Aug 2012)

  New Revision: 64b3e2827d30f54565baa62b5281c9eb9268b85e
  https://github.com/groonga/gcs/commit/64b3e2827d30f54565baa62b5281c9eb9268b85e

  Log:
    Generate new id correctly

  Modified files:
    lib/database/domain.js

  Modified: lib/database/domain.js (+1 -1)
===================================================================
--- lib/database/domain.js    2012-08-09 17:50:56 +0900 (7bda632)
+++ lib/database/domain.js    2012-08-09 17:59:20 +0900 (d37dabc)
@@ -131,7 +131,7 @@ Domain.prototype = {
   createNewId: function() {
     var size = 26;
     var characters = '0123456789abcdefghijklmnopqrstuvwxyz'.split('');
-    var lastIndex = characters.length;
+    var lastIndex = characters.length - 1;
     var id = '';
     while (id.length < size) {
       id += characters[Math.round(Math.random() * lastIndex)];
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Download 



Groonga-commit メーリングリストの案内
Back to archive index