Skip to content

Simplify awk max script

Jacob Vosmaer requested to merge jv-awk-simplify into master

What does this MR do?

This MR updates the gitlab-rails/scripts/wait-for-deps script to use idiomatic Awk.

  1. It is not necessary to initialize variables to 0.
  2. Remove redundant if statement. The old code was roughly saying: "IF true THEN IF $1 > max THEN max = $1 END END" which should rather be "IF $1 > max THEN max = $1 END".

People tend to copy-paste things and I think it is better to have an idiomatic example.

Related issues

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion

Required

  • Merge Request Title, and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Integration tests added to GitLab QA
  • The impact any change in container size has should be evaluated

This change should have absolutely no impact on the code's behavior, it is only for quality of life of contributors. Because of that I don't think any of the checkboxes above apply.

Edited by Jacob Vosmaer

Merge request reports

Loading