diff mbox series

[3/4] utils/get-developers: use Developers.hasfile() where appropriate

Message ID 20201119145354.1175043-3-thomas.petazzoni@bootlin.com
State New
Headers show
Series [1/4] support/scripts/pkg-stats: import cve module only when needed | expand

Commit Message

Thomas Petazzoni Nov. 19, 2020, 2:53 p.m. UTC
Instead of open-coding Developers.hasfile() in utils/get-developers,
use it directly.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 utils/get-developers | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Heiko Thiery Nov. 20, 2020, 10:03 a.m. UTC | #1
Hi Thomas,

Am Do., 19. Nov. 2020 um 15:54 Uhr schrieb Thomas Petazzoni
<thomas.petazzoni@bootlin.com>:
>
> Instead of open-coding Developers.hasfile() in utils/get-developers,
> use it directly.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Tested-by: Heiko Thiery <heiko.thiery@gmail.com>


> ---
>  utils/get-developers | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/utils/get-developers b/utils/get-developers
> index 750fc556dc..20272ed60b 100755
> --- a/utils/get-developers
> +++ b/utils/get-developers
> @@ -77,9 +77,8 @@ def __main__():
>      if args.files is not None:
>          args.files = [os.path.abspath(f) for f in args.files]
>          for dev in devs:
> -            for devfile in dev.files:
> -                commonfiles = [f for f in args.files if f.startswith(devfile)]
> -                if commonfiles:
> +            for f in args.files:
> +                if dev.hasfile(f):
>                      print(dev.name)
>                      break
>

Thank you
diff mbox series

Patch

diff --git a/utils/get-developers b/utils/get-developers
index 750fc556dc..20272ed60b 100755
--- a/utils/get-developers
+++ b/utils/get-developers
@@ -77,9 +77,8 @@  def __main__():
     if args.files is not None:
         args.files = [os.path.abspath(f) for f in args.files]
         for dev in devs:
-            for devfile in dev.files:
-                commonfiles = [f for f in args.files if f.startswith(devfile)]
-                if commonfiles:
+            for f in args.files:
+                if dev.hasfile(f):
                     print(dev.name)
                     break