Kong / unirest-java

Unirest in Java: Simplified, lightweight HTTP client library.
http://kong.github.io/unirest-java/
MIT License
2.6k stars 594 forks source link

feat(Path): optimize param method #507

Closed zhanyeye closed 9 months ago

zhanyeye commented 9 months ago

Hi, I've been exploring unirest-java and appreciate the work you've put into this project. I noticed a small area in the param method where we might reduce the complexity slightly by directly replacing the parameter without pre-counting its occurrences.

This proposed change employs Matcher.find() to ensure the placeholder exists, followed by Matcher.replaceAll() to perform the substitution. It's a subtle tweak that I hope aligns with the project's coding practices.

Thank you for maintaining such a valuable resource for the community.

CLAassistant commented 9 months ago

CLA assistant check
All committers have signed the CLA.