null+****@clear*****
null+****@clear*****
2012年 1月 24日 (火) 15:51:41 JST
Kouhei Sutou 2012-01-24 15:51:41 +0900 (Tue, 24 Jan 2012) New Revision: 07568f4acccdee99db7805f19aeff475515e6632 Log: reduce a function call. Modified files: lib/db.c Modified: lib/db.c (+4 -6) =================================================================== --- lib/db.c 2012-01-24 15:49:49 +0900 (81c61d4) +++ lib/db.c 2012-01-24 15:51:41 +0900 (ad5ffac) @@ -1279,13 +1279,11 @@ grn_table_get(grn_ctx *ctx, grn_obj *table, const void *key, unsigned int key_si grn_id id = GRN_ID_NIL; GRN_API_ENTER; if (table) { + if (table->header.type == GRN_DB) { + grn_db *db = (grn_db *)table; + table = db->keys; + } switch (table->header.type) { - case GRN_DB : - { - grn_db *db = (grn_db *)table; - id = grn_table_get(ctx, db->keys, key, key_size); - } - break; case GRN_TABLE_PAT_KEY : WITH_NORMALIZE((grn_pat *)table, key, key_size, { id = grn_pat_get(ctx, (grn_pat *)table, key, key_size, NULL);