From 96cf9e267a575a078dbcfba6efb0dbe50960501f Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Wed, 2 Nov 2022 12:09:37 -0600 Subject: [PATCH] Per #2224, update existing parse_conf_nbrhd() function to skip parsing the field entry for the nbrhd_prob. This seems preferable to all the duplication involved in writing a new parse_conf_nbrhd_prob() function. --- src/basic/vx_config/config_util.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/basic/vx_config/config_util.cc b/src/basic/vx_config/config_util.cc index 80dee7748f..206f2ffe55 100644 --- a/src/basic/vx_config/config_util.cc +++ b/src/basic/vx_config/config_util.cc @@ -1731,11 +1731,18 @@ NbrhdInfo parse_conf_nbrhd(Dictionary *dict, const char *conf_key) { nbrhd_dict = dict->lookup_dictionary(conf_key); // Conf: field - may be missing - v = nbrhd_dict->lookup_int(conf_key_field, false); - // If found, interpret value. Otherwise, default to BOTH - if(nbrhd_dict->last_lookup_status()) info.field = int_to_fieldtype(v); - else info.field = FieldType_Both; + // Default info.field to BOTH + info.field = FieldType_Both; + + // Skip lookup for conf_key_nbrhd_prob + if(strncmp(conf_key, conf_key_nbrhd_prob, strlen(conf_key_nbrhd_prob)) != 0) { + + v = nbrhd_dict->lookup_int(conf_key_field, false); + + // If found, interpret value + if(nbrhd_dict->last_lookup_status()) info.field = int_to_fieldtype(v); + } // Conf: vld_thresh info.vld_thresh = nbrhd_dict->lookup_double(conf_key_vld_thresh);