Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redmine#7871: use VarRefValueToJson consistently and copy only when n…
…eeded VarRefValueToJson() was no longer used so VarRefValueToJsonAllowScalars() was renamed to it. Fixes a bug in VarRefValueToJsonAllowScalars() that leaked cf_nulls (typo: used value instead of rp). Fixes a bug in SeqShuffle() so it doesn't crash with a 0-length sequence. For https://dev.cfengine.com/issues/7871 the following functions now take a list or an array or a data container, or inline JSON: filter(), getindices(), getvalues(), join(), length(), maplist(), reverse(), unique(), intersection(), difference(), shuffle(), sort(), storejson(), string_mustache(), sublist(), sum(), product(); all the rewritten function got new acceptance tests. Some tests were redundant and thus removed. The following functions were left alone because they're either not needed or too tricky due to legacy issues: regarray(), reglist(), makerule(), nth() We only create copies of the variables if needed, and free them only in that case, which will improve performance. Changelog: Allow inline JSON to be used in function calls (Redmine#7871).
- Loading branch information
Showing
41 changed files
with
2,327 additions
and
1,505 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
143 changes: 0 additions & 143 deletions
143
tests/acceptance/01_vars/02_functions/difference_intersection.cf
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.