File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -49,15 +49,15 @@ std::string get_pretty_size_str_from_bytes_num(int64_t bytes_num) {
49
49
50
50
std::string get_truncated_middle_str (const std::string& src, std::size_t num) {
51
51
std::string result;
52
- static std::size_t minimal_string_size_to_truncate = 20 ;
52
+ constexpr std::size_t minimal_string_size_to_truncate = 20 ;
53
53
if (num < minimal_string_size_to_truncate) {
54
54
num = minimal_string_size_to_truncate;
55
55
}
56
56
constexpr char middle_place_holder[] = " ..." ;
57
57
const std::size_t src_size = src.size ();
58
58
if (src_size > num) {
59
59
int prefix_num = num / 2 ;
60
- int suffix_num = num / 2 - std::strlen (middle_place_holder);/* middle_place_holder.size(); */
60
+ int suffix_num = num / 2 - std::strlen (middle_place_holder);
61
61
result.append (src.substr (0 , prefix_num));
62
62
result.append (middle_place_holder);
63
63
result.append (src.substr (src_size - suffix_num));
You can’t perform that action at this time.
0 commit comments