summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6224f70)
We already know the length because it was computed earlier and stored
in the ring buffer structure, so use this "cached" value instead where
possible.
rbe = ringbuffer_get(bot_win_rb, fvr);
if (!rbe)
return -1;
rbe = ringbuffer_get(bot_win_rb, fvr);
if (!rbe)
return -1;
- len = strlen(rbe->msg);
if (*lines > bot.lines) {
/* first rbe is only partially visible */
offset = (*lines - bot.lines) * bot.cols;
if (*lines > bot.lines) {
/* first rbe is only partially visible */
offset = (*lines - bot.lines) * bot.cols;
struct rb_entry *rbe = ringbuffer_get(bot_win_rb, i);
if (!rbe)
break;
struct rb_entry *rbe = ringbuffer_get(bot_win_rb, i);
if (!rbe)
break;
- lines += NUM_LINES(strlen(rbe->msg));
+ lines += NUM_LINES(rbe->len);
}
i++;
if (lines > 0 && scroll_position != i) {
}
i++;
if (lines > 0 && scroll_position != i) {
struct rb_entry *rbe = ringbuffer_get(bot_win_rb, i);
if (!rbe)
break;
struct rb_entry *rbe = ringbuffer_get(bot_win_rb, i);
if (!rbe)
break;
- lines += NUM_LINES(strlen(rbe->msg));
+ lines += NUM_LINES(rbe->len);
}
if (lines) {
scroll_position = i;
}
if (lines) {
scroll_position = i;