AddProcessEnv was sequentially going through the env array
to check for duplicates, which would become very slow if we
add a huge amount of ENV vars.
Add a map to Generator to keep track of the ENV vars already
added, so that when AddProcessEnv checks for duplicates, it is
much faster.
Also add a new function called AddMultipleProcessEnv,
which takes a []string of ENVs and adds them to the config in one
go.
Add unit tests for these functions.
AddProcessEnv was sequentially going through the env array to check for duplicates, which would become very slow if we add a huge amount of ENV vars. Add a map to Generator to keep track of the ENV vars already added, so that when AddProcessEnv checks for duplicates, it is much faster. Also add a new function called AddMultipleProcessEnv, which takes a []string of ENVs and adds them to the config in one go. Add unit tests for these functions.
Signed-off-by: Urvashi Mohnani umohnani@redhat.com