summaryrefslogtreecommitdiffstats
path: root/git-precheck
diff options
context:
space:
mode:
authorMatt Hunter <m@lfurio.us>2026-05-06 03:55:17 -0400
committerMatt Hunter <m@lfurio.us>2026-05-08 03:53:48 -0400
commitb9ceda00064d7b93ee05702c2a1fa6858b079c07 (patch)
tree283caeec3a1d976ae30344089cd024a8bc46955c /git-precheck
parent5d17b0508e7957b873301357157945bf2dfe2d42 (diff)
downloadgit-sonar-b9ceda00064d7b93ee05702c2a1fa6858b079c07.tar.gz
git-sonar-b9ceda00064d7b93ee05702c2a1fa6858b079c07.zip
Remove outer grep in prepare_element for speedup
The initial grep in prepare_element serves as a guard to prevent evaluation of element outputs which _arent_ present in the user' format string. However, if in the assumed general case where most (if not all) of the elements will be enabled *somewhere* in the prompt string, this check becomes entirely redundant with the main sed statement which runs at the end of the script. It's not a matter of if an element is present, but where - which is what the sed substitutions address. The downside of this change of course is that the prompt doesn't necessarily benefit from speedups just by omiting elements from the format string. However, the appropriate feature option (eg --no-status) can be used in this case to effectively turn the corresponding element into a no-op. In return, the "general" case (with all features enabled) is a bit faster. Signed-off-by: Matt Hunter <m@lfurio.us>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions