mirror of https://github.com/ecmwf/eccodes.git
ECC-1898: Remove alias from cache
This commit is contained in:
parent
879f5b0aea
commit
9363aa9241
|
@ -137,6 +137,8 @@ static int create_accessor(grib_section* p, grib_action* act, grib_loader* h)
|
||||||
if (x->name_space_ == NULL)
|
if (x->name_space_ == NULL)
|
||||||
x->name_space_ = act->name_space;
|
x->name_space_ = act->name_space;
|
||||||
|
|
||||||
|
// TODO(maee): Make sure that the accessor is added to the trie
|
||||||
|
|
||||||
grib_context_log(p->h->context, GRIB_LOG_DEBUG, "alias: add only namespace: %s.%s",
|
grib_context_log(p->h->context, GRIB_LOG_DEBUG, "alias: add only namespace: %s.%s",
|
||||||
act->name_space, act->name);
|
act->name_space, act->name);
|
||||||
i = 0;
|
i = 0;
|
||||||
|
@ -178,6 +180,13 @@ static int create_accessor(grib_section* p, grib_action* act, grib_loader* h)
|
||||||
act->name_space, act->name, y->name_);
|
act->name_space, act->name, y->name_);
|
||||||
/* printf("[%s %s]\n",y->all_names_[i], y->all_name_spaces_[i]); */
|
/* printf("[%s %s]\n",y->all_names_[i], y->all_name_spaces_[i]); */
|
||||||
|
|
||||||
|
// ECC-1898: Remove accessor from cache
|
||||||
|
grib_handle* hand = grib_handle_of_accessor(y);
|
||||||
|
if (hand->use_trie && y->all_name_spaces_[i] != NULL && strcmp(y->name_, act->name) != 0) {
|
||||||
|
int id = grib_hash_keys_get_id(hand->context->keys, act->name);
|
||||||
|
hand->accessors[id] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
while (i < MAX_ACCESSOR_NAMES - 1) {
|
while (i < MAX_ACCESSOR_NAMES - 1) {
|
||||||
y->all_names_[i] = y->all_names_[i + 1];
|
y->all_names_[i] = y->all_names_[i + 1];
|
||||||
y->all_name_spaces_[i] = y->all_name_spaces_[i + 1];
|
y->all_name_spaces_[i] = y->all_name_spaces_[i + 1];
|
||||||
|
|
Loading…
Reference in New Issue