diff options
author | Juan Manuel Tomás <jtomas1815@gmail.com> | 2020-04-01 09:33:46 -0300 |
---|---|---|
committer | Juan Manuel Tomás <jtomas1815@gmail.com> | 2020-04-01 09:33:46 -0300 |
commit | 8f45be3b0ddab6e6fd6ce8aed99e921871e9961b (patch) | |
tree | c8c4803650eb9aac3f29e5e47ffef9b0d8f22ee1 /page.c | |
parent | aaeea79c5bd531bd493aec09bd4eed0ac0ea59df (diff) | |
download | jet-8f45be3b0ddab6e6fd6ce8aed99e921871e9961b.tar.gz jet-8f45be3b0ddab6e6fd6ce8aed99e921871e9961b.zip |
Inline page_is_full and delete page_is_empty
Diffstat (limited to 'page.c')
-rw-r--r-- | page.c | 11 |
1 files changed, 1 insertions, 10 deletions
@@ -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++; } |