Simplify a bit the detect_arch function 148/head
authorjvoisin <julien.voisin@dustri.org>
Tue, 16 Jul 2024 23:38:32 +0000 (01:38 +0200)
committerjvoisin <julien.voisin@dustri.org>
Tue, 16 Jul 2024 23:38:32 +0000 (01:38 +0200)
commit0b0c575e3c6e0279d2466deb4d2d0a20a6444f41
treeed072f4b69af22e280a105f76662d3a555da818c
parenteb1f11a8f647309c7d7f425c8ef28ca82f6b3ba5
Simplify a bit the detect_arch function

- Use a regex to extract the arch instead of doing the extraction "by hand".
- Reduce nested indentation.
- Reduce the amount of code in the loop.
- Remove a forceful `re.compile`: python will cache regex in a compiled form if
  necessary.
kernel_hardening_checker/__init__.py