Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
主要改进内容:
String.formart()
方法,优化字符串拼接性能(建议尽量不要使用String.format()
进行字符串拼接 )。replaceAll("\\.", replacement)
替换为replace(".", replacement)
(避免不必要的正则表达式替换开销)。new
一个匿名类。 除非确实能够比较优雅地减少代码量,否则建议在使用 Lambda 时尽量保持克制,以降低运行开销。更不建议在不能减少代码量的情况下,为了 Lambda 而 Lambda 。大多数情况下,都可以通过提前封装好工具方法,来实现更少的代码量,并且性能也会有一定提升,如果优化得当,还可以提升数倍)。