[Groonga-commit] groonga/gcs [master] Don't cache value of actualType to type

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Nov 21 18:25:16 JST 2012


YUKI Hiroshi	2012-11-21 18:25:16 +0900 (Wed, 21 Nov 2012)

  New Revision: 71229ebdb09ab5a88aa28ec92fa3a0a78c0aafd0
  https://github.com/groonga/gcs/commit/71229ebdb09ab5a88aa28ec92fa3a0a78c0aafd0

  Log:
    Don't cache value of actualType to type

  Modified files:
    lib/database/index-field.js

  Modified: lib/database/index-field.js (+8 -6)
===================================================================
--- lib/database/index-field.js    2012-11-21 18:13:44 +0900 (3ceb978)
+++ lib/database/index-field.js    2012-11-21 18:25:16 +0900 (53817dd)
@@ -205,7 +205,9 @@ IndexField.prototype = {
   },
 
   get type() {
-    return this._type || this.actualType;
+    if (!this._type)
+      this._type = this.actualType;
+    return this._type;
   },
   get actualType() {
     var column = this.column;
@@ -214,14 +216,14 @@ IndexField.prototype = {
 
     if (column.type == 'var') {
       if (column.range == nroonga.ShortText)
-        return this._type = 'text';
+        return 'text';
       if (column.range == this.indexTableName)
-        return this._type = 'literal';
+        return 'literal';
     } else if (column.type == 'fix') {
       if (column.range == nroonga.UInt32)
-        return this._type = 'uint';
+        return 'uint';
       else if (column.range == this.indexTableName)
-        return this._type = 'literal';
+        return 'literal';
     }
 
     throw new Error('unknown unfixed column ' + this.columnName);
@@ -575,7 +577,7 @@ IndexField.prototype = {
     var values = this.domain.dumpSync();
     var multipleValues = this.multipleValues;
     this.deleteSync();
-    this._type = type;
+    this.type = type;
     this.saveSync(multipleValues);
     var name = this.columnName;
     values.forEach(function(record) {
-------------- next part --------------
HTML����������������������������...
Download 



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