From bb142400e17346683e7060cd3e70d8d01d20771c Mon Sep 17 00:00:00 2001 From: Roland Illig Date: Mon, 27 Jun 2005 22:11:55 +0000 Subject: [PATCH] * view.c: Massive speed-ups by reordering statements and declaring functions as inline. --- src/ChangeLog | 6 ++---- src/view.c | 8 ++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 9d8c0acf7..588b6809b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,9 +1,7 @@ 2005-06-27 Roland Illig - * view.c (is_nroff_sequence): Reordered the statements to gain - a speed-off of 30 percent on a 10 MB file. - (coord_cache_entry_less): Another speed-up by declaring the - function as inline. + * view.c: Massive speed-ups by reordering statements and declaring + functions as inline. 2005-06-22 Pavel Tsekov diff --git a/src/view.c b/src/view.c index a7e8a2080..63b1e2bbc 100644 --- a/src/view.c +++ b/src/view.c @@ -471,13 +471,13 @@ view_may_still_grow (WView *view) /* returns TRUE if the idx lies in the half-open interval * [offset; offset + size), FALSE otherwise. */ -static gboolean +static inline gboolean already_loaded (offset_type offset, offset_type idx, size_t size) { return (offset <= idx && idx - offset < size); } -static void +static inline void view_file_load_data (WView *view, offset_type byte_index) { offset_type blockoffset; @@ -522,7 +522,7 @@ get_byte_none (WView *view, offset_type byte_index) return -1; } -static int +static inline int get_byte_file (WView *view, offset_type byte_index) { assert (view->datasource == DS_FILE); @@ -542,7 +542,7 @@ get_byte_string (WView *view, offset_type byte_index) return -1; } -static int +static inline int get_byte (WView *view, offset_type offset) { switch (view->datasource) {