diff options
| author | Matt Hunter <m@lfurio.us> | 2026-05-06 03:55:17 -0400 |
|---|---|---|
| committer | Matt Hunter <m@lfurio.us> | 2026-05-08 03:53:48 -0400 |
| commit | b9ceda00064d7b93ee05702c2a1fa6858b079c07 (patch) | |
| tree | 283caeec3a1d976ae30344089cd024a8bc46955c /git-radar | |
| parent | 5d17b0508e7957b873301357157945bf2dfe2d42 (diff) | |
| download | git-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 'git-radar')
0 files changed, 0 insertions, 0 deletions
