simplifications
authorPierre Habouzit <madcoder@debian.org>
Mon, 18 Dec 2006 18:31:06 +0000 (19:31 +0100)
committerPierre Habouzit <madcoder@debian.org>
Mon, 18 Dec 2006 18:31:06 +0000 (19:31 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
pager.c

diff --git a/pager.c b/pager.c
index 083c9b0..3f1db6e 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -311,21 +311,15 @@ shift_class_colors (struct q_class_t *QuoteList, struct q_class_t *new_class,
   (*q_level)++;
 }
 
-static void cleanup_quote (struct q_class_t **QuoteList)
+static void cleanup_quote(struct q_class_t **QuoteList)
 {
-  struct q_class_t *ptr;
-
-  while (*QuoteList) {
-    if ((*QuoteList)->down)
-      cleanup_quote (&((*QuoteList)->down));
-    ptr = (*QuoteList)->next;
-    if ((*QuoteList)->prefix)
-      p_delete(&(*QuoteList)->prefix);
-    p_delete(QuoteList);
-    *QuoteList = ptr;
-  }
-
-  return;
+    while (*QuoteList) {
+        struct q_class_t *ptr = (*QuoteList)->next;
+        cleanup_quote(&(*QuoteList)->down);
+        p_delete(&(*QuoteList)->prefix);
+        p_delete(QuoteList);
+        *QuoteList = ptr;
+    }
 }
 
 static struct q_class_t *classify_quote (struct q_class_t **QuoteList,
@@ -1674,8 +1668,8 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
           lineInfo[i].quote = NULL;
 
           p_realloc(&lineInfo[i].syntax, 1);
-          if (SearchCompiled && lineInfo[i].search)
-            p_delete(&(lineInfo[i].search));
+          if (SearchCompiled)
+            p_delete(&lineInfo[i].search);
         }
 
         lastLine = 0;
@@ -1848,8 +1842,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
       if (SearchCompiled) {
         regfree (&SearchRE);
         for (i = 0; i < lastLine; i++) {
-          if (lineInfo[i].search)
-            p_delete(&(lineInfo[i].search));
+          p_delete(&lineInfo[i].search);
           lineInfo[i].search_cnt = -1;
         }
       }
@@ -1862,8 +1855,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
         regfree (&SearchRE);
         for (i = 0; i < maxLine; i++) {
           /* cleanup */
-          if (lineInfo[i].search)
-            p_delete(&(lineInfo[i].search));
+          p_delete(&lineInfo[i].search);
           lineInfo[i].search_cnt = -1;
         }
         SearchFlag = 0;
@@ -2152,8 +2144,8 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
           lineInfo[i].quote = NULL;
 
           p_realloc(&(lineInfo[i].syntax), 1);
-          if (SearchCompiled && lineInfo[i].search)
-            p_delete(&(lineInfo[i].search));
+          if (SearchCompiled)
+            p_delete(&lineInfo[i].search);
         }
 
         if (SearchCompiled) {
@@ -2522,12 +2514,12 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
     }
   }
 
-  cleanup_quote (&QuoteList);
+  cleanup_quote(&QuoteList);
 
   for (i = 0; i < maxLine; i++) {
-    p_delete(&(lineInfo[i].syntax));
-    if (SearchCompiled && lineInfo[i].search)
-      p_delete(&(lineInfo[i].search));
+    p_delete(&lineInfo[i].syntax);
+    if (SearchCompiled)
+      p_delete(&lineInfo[i].search);
   }
   if (SearchCompiled) {
     regfree (&SearchRE);