Skip to content

Conversation

@mihalycsokas
Copy link
Collaborator

#8

@mihalycsokas mihalycsokas requested a review from torokmark April 27, 2021 11:08
local contains="1"

for i in "${!map_name[@]}"
do
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Place do at the end of for header.

declare -n map_name="$1"
local element="$2"
local msg="${3-}"
local contains="1"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not need quotation marks around 1

for i in "${!map_name[@]}"
do
if [[ "${map_name[$i]}" = "$element" ]]; then
contains="0"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can return here.

done

if [ "$contains" != "0" ]; then
[ "${#msg}" -gt 0 ] && log_failure $msg || true
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Place quotation marks around $msg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants