[Groonga-commit] groonga/gcs [master] Use tableExistsSync()

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Aug 22 19:22:44 JST 2012


YUKI Hiroshi	2012-08-22 19:22:44 +0900 (Wed, 22 Aug 2012)

  New Revision: c1fccfce30063e4a3580d06460c45ea2d8154638
  https://github.com/groonga/gcs/commit/c1fccfce30063e4a3580d06460c45ea2d8154638

  Log:
    Use tableExistsSync()

  Modified files:
    lib/database/domain.js
    lib/wrapped-nroonga.js

  Modified: lib/database/domain.js (+1 -4)
===================================================================
--- lib/database/domain.js    2012-08-22 19:04:56 +0900 (7278db7)
+++ lib/database/domain.js    2012-08-22 19:22:44 +0900 (84e686b)
@@ -417,10 +417,7 @@ Domain.prototype = {
   },
 
   hasSynonymsTableSync: function() {
-    var tables = this.context.tableListSync();
-    return tables.some(function(table) {
-      return table.name === this.synonymsTableName;
-    }, this);
+    return this.context.tableExistsSync(this.synonymsTableName);
   },
 
   exists: function() {

  Modified: lib/wrapped-nroonga.js (+7 -0)
===================================================================
--- lib/wrapped-nroonga.js    2012-08-22 19:04:56 +0900 (ae6ab06)
+++ lib/wrapped-nroonga.js    2012-08-22 19:22:44 +0900 (98269d4)
@@ -86,6 +86,13 @@ Context.prototype = {
     return formatResults(result);
   },
 
+  tableExistsSync: function(tableName) {
+    var tables = this.tableListSync();
+    return tables.some(function(table) {
+             return table.name == tableName);
+           });
+  },
+
   columnListSync: function(tableName) {
     var result =  this.commandSync('column_list', { table: tableName });
     return formatResults(result);
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index