From 8f45be3b0ddab6e6fd6ce8aed99e921871e9961b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Wed, 1 Apr 2020 09:33:46 -0300 Subject: Inline page_is_full and delete page_is_empty --- page.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/page.c b/page.c index ec8f9b0..a8407d3 100644 --- a/page.c +++ b/page.c @@ -67,17 +67,8 @@ void move_gap(struct page *page, int target) { } } -static inline int page_is_full(struct page *page) { - return page->gap_start == page->gap_end; -} - -static inline int page_is_empty(struct page *page) { - return page->gap_start == page->buffer - && page->gap_end == page->buffer + PAGE_SIZE - 1; -} - void insert_into_page(struct page *page, uint8_t c) { - if (!page_is_full(page)) { + if (page->gap_start != page->gap_end) { *(page->gap_start) = c; page->gap_start++; } -- cgit v1.2.3