Navigation Menu

Skip to content

Commit

Permalink
Remove GRN_JA_SKIP_SAME_VALUE_PUT check
Browse files Browse the repository at this point in the history
Now ,the feature is always enabled.
  • Loading branch information
kou committed Apr 15, 2015
1 parent a60981f commit f39b9d9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 21 deletions.
15 changes: 0 additions & 15 deletions lib/ctx.c
Expand Up @@ -807,20 +807,6 @@ check_overcommit_memory(grn_ctx *ctx)
fclose(file);
}

static void
check_grn_ja_skip_same_value_put(grn_ctx *ctx)
{
char grn_ja_skip_same_value_put_env[GRN_ENV_BUFFER_SIZE];

grn_getenv("GRN_JA_SKIP_SAME_VALUE_PUT",
grn_ja_skip_same_value_put_env,
GRN_ENV_BUFFER_SIZE);
if (grn_ja_skip_same_value_put_env[0] &&
strcmp(grn_ja_skip_same_value_put_env, "no") == 0) {
grn_ja_skip_same_value_put = GRN_FALSE;
}
}

grn_rc
grn_init(void)
{
Expand Down Expand Up @@ -935,7 +921,6 @@ grn_init(void)
}
GRN_LOG(ctx, GRN_LOG_NOTICE, "grn_init");
check_overcommit_memory(ctx);
check_grn_ja_skip_same_value_put(ctx);
return rc;
}

Expand Down
2 changes: 0 additions & 2 deletions lib/grn_store.h
Expand Up @@ -71,8 +71,6 @@ void *grn_ra_ref_cache(grn_ctx *ctx, grn_ra *ra, grn_id id, grn_ra_cache *cache)

/**** variable sized elements ****/

extern grn_bool grn_ja_skip_same_value_put;

typedef struct _grn_ja grn_ja;

struct _grn_ja {
Expand Down
5 changes: 1 addition & 4 deletions lib/store.c
Expand Up @@ -338,8 +338,6 @@ struct grn_ja_header {
#define SEGMENTS_GINFO_ON(ja,seg,width) (SEGMENTS_AT(ja,seg) = SEG_GINFO|(width))
#define SEGMENTS_OFF(ja,seg) (SEGMENTS_AT(ja,seg) = 0)

grn_bool grn_ja_skip_same_value_put = GRN_TRUE;

static grn_ja *
_grn_ja_create(grn_ctx *ctx, grn_ja *ja, const char *path,
unsigned int max_element_size, uint32_t flags)
Expand Down Expand Up @@ -901,8 +899,7 @@ grn_ja_put_raw(grn_ctx *ctx, grn_ja *ja, grn_id id,
grn_io_win iw;
grn_ja_einfo einfo;

if (grn_ja_skip_same_value_put &&
(flags & GRN_OBJ_SET_MASK) == GRN_OBJ_SET &&
if ((flags & GRN_OBJ_SET_MASK) == GRN_OBJ_SET &&
value_len > 0) {
grn_io_win jw;
uint32_t old_len;
Expand Down

0 comments on commit f39b9d9

Please sign in to comment.