[Groonga-commit] groonga/grnxx at 7559d14 [master] Remove an old comment.

Back to archive index

susumu.yata null+****@clear*****
Thu Dec 4 19:12:08 JST 2014


susumu.yata	2014-12-04 19:12:08 +0900 (Thu, 04 Dec 2014)

  New Revision: 7559d14e9238ab43163f55fc957394eceead3a7c
  https://github.com/groonga/grnxx/commit/7559d14e9238ab43163f55fc957394eceead3a7c

  Message:
    Remove an old comment.

  Modified files:
    lib/grnxx/impl/column/scalar/text.cpp

  Modified: lib/grnxx/impl/column/scalar/text.cpp (+0 -39)
===================================================================
--- lib/grnxx/impl/column/scalar/text.cpp    2014-12-04 16:54:06 +0900 (7ea812f)
+++ lib/grnxx/impl/column/scalar/text.cpp    2014-12-04 19:12:08 +0900 (f7036ae)
@@ -217,45 +217,6 @@ void Column<Text>::set_key_attribute() {
   is_key_ = true;
 }
 
-//bool Column<Text>::set_key_attribute(Error *error) {
-//  if (has_key_attribute_) {
-//    GRNXX_ERROR_SET(error, INVALID_OPERATION,
-//                    "This column is a key column");
-//    return false;
-//  }
-//  // TODO: An index should be used if possible.
-//  try {
-//    std::set<Text> set;
-//    // TODO: Functor-based inline callback may be better in this case,
-//    //       because it does not require memory allocation.
-//    auto cursor = table_->create_cursor(nullptr);
-//    if (!cursor) {
-//      return false;
-//    }
-//    Array<Record> records;
-//    for ( ; ; ) {
-//      auto result = cursor->read(nullptr, 1024, &records);
-//      if (!result.is_ok) {
-//        return false;
-//      } else {
-//        break;
-//      }
-//      for (Int i = 0; i < result.count; ++i) {
-//        if (!set.insert(get(records.get_row_id(i))).second) {
-//          GRNXX_ERROR_SET(error, INVALID_OPERATION, "Key duplicate");
-//          return false;
-//        }
-//      }
-//      records.clear();
-//    }
-//  } catch (...) {
-//    GRNXX_ERROR_SET(error, NO_MEMORY, "Memory allocation failed");
-//    return false;
-//  }
-//  has_key_attribute_ = true;
-//  return true;
-//}
-
 void Column<Text>::unset_key_attribute() {
   if (!is_key_) {
     throw "Not key column";  // TODO
-------------- next part --------------
HTML����������������������������...
Descargar 



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