From e4992e83a0fc4ae9050a7d6c9d0b32b23ec58cb9 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 26 Nov 2015 12:06:40 +1100 Subject: [PATCH] Remove pane_point. Only one called remains, so open-code it there. That caller should eventually go too. Signed-off-by: NeilBrown --- core-keymap.c | 9 +++++++-- core.h | 8 -------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/core-keymap.c b/core-keymap.c index 1a7b5aca..d31f8ad9 100644 --- a/core-keymap.c +++ b/core-keymap.c @@ -304,8 +304,13 @@ int key_handle(struct cmd_info *ci) ci->hx = ci->x; ci->hy = ci->y; - if (!ci->pointp) - ci->pointp = pane_point(p); + if (!ci->pointp) { + struct pane *p2 = p; + while (p2 && !p2->point) + p2 = p2->parent; + if (p2) + ci->pointp = &p2->point; + } while (ret == 0 && p) { if (p->handle) { ci->home = p; diff --git a/core.h b/core.h index 4ca0ff9e..1534e095 100644 --- a/core.h +++ b/core.h @@ -309,14 +309,6 @@ struct pane *pane_attach(struct pane *p, char *type, struct pane *dp, char *arg) void pane_clear(struct pane *p, char *attrs); void pane_text(struct pane *p, wchar_t ch, char *attrs, int x, int y); char *pane_attr_get(struct pane *p, char *key); -static inline struct point **pane_point(struct pane *p) -{ - while (p && !p->point) - p = p->parent; - if (p) - return &p->point; - return NULL; -} static inline struct pane *pane_child(struct pane *p) { -- 2.39.5