diff options
author | Nicolas Pitre <nico@fluxnic.net> | 2021-05-10 23:37:37 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2021-05-10 23:37:37 -0400 |
commit | 627799c1e4253108520167c1d7cc682813dc7ced (patch) | |
tree | 38f3af871b457759340c898712c49b8add0213c9 | |
parent | 49f8010b606b92c21ec46d706b992d382b1acb84 (diff) |
avoid floating point computation when integer computation is sufficient
Floats are much more expensive to use in CPU cycles than integers.
-rw-r--r-- | src/tui.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1010,7 +1010,7 @@ void ui_show_content(WINDOW * win, int row_boundary, int col_boundary) { // auto wrap if (!conf_truncate && !conf_overlap && conf_autowrap) { - int newheight = ceil(wcslen(out) * 1.0 / fwidth[col]); + int newheight = (wcslen(out) + fwidth[col] - 1) / fwidth[col]; if (row_format[row] < newheight) row_format[row] = newheight; } |