Skip to content

Commit

Permalink
Use "expr" instead of "expression" for API
Browse files Browse the repository at this point in the history
Because we use "expr" in other codes.
  • Loading branch information
kou committed Mar 16, 2017
1 parent 60ae506 commit 4347167
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions include/groonga/table.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ GRN_API grn_obj *grn_table_tokenize(grn_ctx *ctx, grn_obj *table,
const char *str, unsigned int str_len,
grn_obj *buf, grn_bool addp);

GRN_API grn_rc grn_table_apply_expression(grn_ctx *ctx,
grn_obj *table,
grn_obj *output_column,
grn_obj *expression);
GRN_API grn_rc grn_table_apply_expr(grn_ctx *ctx,
grn_obj *table,
grn_obj *output_column,
grn_obj *expr);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion lib/proc/proc_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ grn_select_apply_columns(grn_ctx *ctx,
}
} else {
grn_rc rc;
rc = grn_table_apply_expression(ctx, table, column, expression);
rc = grn_table_apply_expr(ctx, table, column, expression);
if (rc != GRN_SUCCESS) {
grn_obj_close(ctx, expression);
grn_obj_close(ctx, column);
Expand Down
8 changes: 4 additions & 4 deletions lib/table.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@
#include "grn_ctx.h"

grn_rc
grn_table_apply_expression(grn_ctx *ctx,
grn_table_apply_expr(grn_ctx *ctx,
grn_obj *table,
grn_obj *output_column,
grn_obj *expression)
grn_obj *expr)
{
grn_obj *record;

GRN_API_ENTER;

record = grn_expr_get_var_by_offset(ctx, expression, 0);
record = grn_expr_get_var_by_offset(ctx, expr, 0);
GRN_TABLE_EACH_BEGIN_FLAGS(ctx, table, cursor, id, GRN_CURSOR_BY_ID) {
grn_obj *value;
GRN_RECORD_SET(ctx, record, id);
value = grn_expr_exec(ctx, expression, 0);
value = grn_expr_exec(ctx, expr, 0);
if (value) {
grn_obj_set_value(ctx, output_column, id, value, GRN_OBJ_SET);
}
Expand Down

0 comments on commit 4347167

Please sign in to comment.