From 52a3c85ef0baad016f2b324644f34d9fd62f7d34 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 13 Nov 2007 13:41:51 +0000 Subject: [PATCH] Use zebra_map_get_or_add instead of zebra_map_get for searches. Use zebra_map_get_or_add instead of zebra_map_get for searches. For systems that do not define default.idx the system must generate a zebra map for it (and warn if default.idx was used). --- index/rpnscan.c | 4 ++-- index/rpnsearch.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/index/rpnscan.c b/index/rpnscan.c index 3402e77..6d575df 100644 --- a/index/rpnscan.c +++ b/index/rpnscan.c @@ -1,4 +1,4 @@ -/* $Id: rpnscan.c,v 1.21 2007-11-05 11:20:39 adam Exp $ +/* $Id: rpnscan.c,v 1.22 2007-11-13 13:41:51 adam Exp $ Copyright (C) 1995-2007 Index Data ApS @@ -290,7 +290,7 @@ static ZEBRA_RES rpn_scan_norm(ZebraHandle zh, ODR stream, NMEM nmem, { struct scan2_info_entry *ar = nmem_malloc(nmem, sizeof(*ar) * ord_no); struct rpn_char_map_info rcmi; - zebra_map_t zm = zebra_map_get(zh->reg->zebra_maps, index_type); + zebra_map_t zm = zebra_map_get_or_add(zh->reg->zebra_maps, index_type); int i, dif; int after_pos; int pos = 0; diff --git a/index/rpnsearch.c b/index/rpnsearch.c index d07bf3f..b9350c8 100644 --- a/index/rpnsearch.c +++ b/index/rpnsearch.c @@ -1,4 +1,4 @@ -/* $Id: rpnsearch.c,v 1.21 2007-11-08 21:21:58 adam Exp $ +/* $Id: rpnsearch.c,v 1.22 2007-11-13 13:41:51 adam Exp $ Copyright (C) 1995-2007 Index Data ApS @@ -987,7 +987,7 @@ static ZEBRA_RES string_term(ZebraHandle zh, Z_AttributesPlusTerm *zapt, int relation_error; char ord_buf[32]; int ord_len, i; - zebra_map_t zm = zebra_map_get(zh->reg->zebra_maps, index_type); + zebra_map_t zm = zebra_map_get_or_add(zh->reg->zebra_maps, index_type); *ol = ord_list_create(stream); @@ -1319,7 +1319,7 @@ static ZEBRA_RES rpn_search_APT_position(ZebraHandle zh, int ord_len; char *val; ISAM_P isam_p; - zebra_map_t zm = zebra_map_get(zh->reg->zebra_maps, index_type); + zebra_map_t zm = zebra_map_get_or_add(zh->reg->zebra_maps, index_type); attr_init_APT(&position, zapt, 3); position_value = attr_find(&position, NULL); @@ -1678,7 +1678,7 @@ static ZEBRA_RES numeric_term(ZebraHandle zh, Z_AttributesPlusTerm *zapt, int relation_error = 0; int ord, ord_len, i; char ord_buf[32]; - zebra_map_t zm = zebra_map_get(zh->reg->zebra_maps, index_type); + zebra_map_t zm = zebra_map_get_or_add(zh->reg->zebra_maps, index_type); *ol = ord_list_create(stream); -- 1.7.10.4