From: Joseph Sutton Date: Thu, 12 Oct 2023 22:23:27 +0000 (+1300) Subject: buildtools: Don’t call normpath() repeatedly X-Git-Tag: talloc-2.4.2~1285 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec23abfe1f77b756ea63f4fc0a572c4d9cd8c30b;p=thirdparty%2Fsamba.git buildtools: Don’t call normpath() repeatedly A non‐negligible fraction of the build process — especially for incremental builds — is spent calling normpath() over and over again. Make builds faster by not doing that. Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py index 39512f0ac96..b22b7a8879b 100644 --- a/buildtools/wafsamba/samba_utils.py +++ b/buildtools/wafsamba/samba_utils.py @@ -710,8 +710,9 @@ def samba_before_apply_obj_vars(self): """before apply_obj_vars for uselib, this removes the standard paths""" def is_standard_libpath(env, path): + normalized_path = os.path.normpath(path) for _path in env.STANDARD_LIBPATH: - if _path == os.path.normpath(path): + if _path == normalized_path: return True return False