This repository has been archived by the owner on Oct 26, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize computeRoutePrefix (prometheus#584)
* Optimize computeRoutePrefix Previously, computeRoutePrefix was adding a '/' to the start of the prefix and then removing it from the end, regardless of whether it was there or not. This resulted in unnecessary string operations. The updated function only adds or removes the '/' when necessary, improving efficiency. Additionally, the function now uses strings.HasPrefix and strings.HasSuffix for clearer intent and readability. Signed-off-by: donuts-are-good <[email protected]> --------- Signed-off-by: donuts-are-good <[email protected]>
- Loading branch information