Optimized search performance for large lists by sorting and binary search

This commit is contained in:
Olof hagsand 2017-12-27 11:34:47 +01:00
parent b743b0a080
commit 4b92dbdc10
28 changed files with 1405 additions and 701 deletions

View file

@ -382,6 +382,11 @@ clicon_options_main(clicon_handle h)
/* Read configfile */
if (clicon_option_readfile_xml(copt, configfile, yspec) < 0)
goto done;
/* Specific option handling */
if (clicon_option_bool(h, "CLICON_XML_SORT") == 1)
xml_child_sort = 1;
else
xml_child_sort = 0;
}
else {
#ifdef CONFIG_COMPAT
@ -409,6 +414,7 @@ clicon_options_main(clicon_handle h)
/*! Check if a clicon option has a value
* @param[in] h clicon_handle
* @param[in] name option name
* @retval
*/
int
clicon_option_exists(clicon_handle h,