[groonga-dev,00054] grn_table_cursor_table()を追加してほしい

アーカイブの一覧に戻る

Kouhei Sutou kou****@clear*****
2009年 4月 28日 (火) 17:45:38 JST


須藤です。

カーソルが属しているテーブルを返すgrn_table_cursor_table()
を追加してもらえないでしょうか?

  http://github.com/kou/groonga/commit/4acf670f57d753ba393f68fe156c468548b3ed5a

テーブルからカーソルを作る部分と、作ったカーソルを操作する部
分を別関数で行うときにカーソルだけではなくてテーブルも持ちま
わなければいけないのが少し不便です。

Before:
  static void
  dump_cursor_need_table (grn_ctx *context, grn_table_cursor *cursor, grn_obj *table)
  {
    grn_obj *column;

    column = grn_table_column(context, table, "name", strlen("name"));
    while (grn_table_cursor_next(context, cursor) != GRN_ID_NIL) {
      ...
    }
  }

After:
  static void
  dump_cursor_no_need_table (grn_ctx *context, grn_table_cursor *cursor)
  {
    grn_obj *table;
    grn_obj *column;

    table = grn_table_cursor_table(context, cursor);
    column = grn_table_column(context, table, "name", strlen("name"));
    while (grn_table_cursor_next(context, cursor) != GRN_ID_NIL) {
      ...
    }
  }

--
須藤 功平 <kou****@clear*****>

株式会社クリアコード (http://www.clear-code.com/)




groonga-dev メーリングリストの案内
アーカイブの一覧に戻る