Conversation
|
isBlank() and isEmpty() are two meanings: isBlank() not only includes empty check and includes space, tab key and line feed check |
|
I‘ll reject this PR |
|
hi~goson, plz take care that I use Accoring to the jdk document, it seems that Or could you give me a unit test to show the differences?Thanks. @gosonzhang |
|
trim() : returns a string whose value is this string, with any leading and trailing whitespace removed. |
tisonkun
left a comment
There was a problem hiding this comment.
Thanks for your contribution @zehuaiWANG . I second @gosonzhang that this pr might be invalid.
Basically TStringUtils comes from outside codebase that is verified quite a long time. And I don't think we gain too much by this refactor. We do neither improve performance nor readability. The original code is expressive IMO.
|
After I think about it, this PR reminds me that if the content of a string has been checked by isBlank() and the string still exists in memory, the next step is to do null judgment processing, which should only be isEmpty(), so as to improve the overall processing performance. isBlank () can solve the problem that the content of the external input system is not standardized. It is not appropriate to modify this method. I think it would be better to contribute other PRs to solve these problems 這個問題我想了下,@zehuaiWANG这个PR提醒了我: 如果一个字符串的内容已经被isBlank ()检查过,并且字符串仍然存在于内存中時,接下來的内容判断操作只需要用isEmpty()就可以了,這樣可以提高整个的处理性能。 |
|
I'll close this PR, and trace this question by #123 Thanks for @zehuaiWANG |
Change list: * Migrate all bdb configs. * Change to relative path in configs * Modify config reading codes * Add "deprecated" warning Signed-off-by: pingyu <shui.yu@126.com>
No description provided.