From 3c910a481805ce9a5471b3ca35dc71c2827a05e2 Mon Sep 17 00:00:00 2001 From: David Zbarsky Date: Wed, 29 Oct 2025 13:20:51 -0400 Subject: [PATCH] perf: Speedup root_relative_path --- cc/common/cc_helper_internal.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cc/common/cc_helper_internal.bzl b/cc/common/cc_helper_internal.bzl index fbf4078a..c0cdb4fe 100644 --- a/cc/common/cc_helper_internal.bzl +++ b/cc/common/cc_helper_internal.bzl @@ -357,7 +357,7 @@ def root_relative_path(file): (str) The root-relative path of the file. """ if not file.is_source: - return paths.relativize(file.path, file.root.path) + return file.path[len(file.root.path) + 1:] short_path = file.short_path if not short_path.startswith("../"): return short_path