]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/imap/imap_list.c
Removed IsEmptyStr from some loops as its quicker this way (probably).
[citadel.git] / citadel / modules / imap / imap_list.c
index 57bb65864dbfbdc3e4b4ba072e7fb0929d8385d5..ad01e6c0980504200097988fbe054b877704adb9 100644 (file)
@@ -139,7 +139,7 @@ void imap_listroom(struct ctdlroom *qrbuf, void *data)
         * We'll fix this later when we have time.
         */
        if (return_children) {
-               if (strlen(return_options) > 0) {
+               if (!IsEmptyStr(return_options)) {
                        strcat(return_options, " ");
                }
                strcat(return_options, "\\HasChildren");
@@ -250,7 +250,7 @@ void imap_list(int num_parms, char *parms[])
                selection_left = 2;
                paren_nest = 0;
                for (i=2; i<num_parms; ++i) {
-                       for (j=0; j<strlen(parms[i]); ++j) {
+                       for (j=0; parms[i][j]; ++j) {
                                if (parms[i][j] == '(') ++paren_nest;
                                if (parms[i][j] == ')') --paren_nest;
                        }
@@ -314,7 +314,7 @@ void imap_list(int num_parms, char *parms[])
                extended_list_in_use = 1;
                paren_nest = 0;
                for (i=patterns_left; i<num_parms; ++i) {
-                       for (j=0; j<strlen(parms[i]); ++j) {
+                       for (j=0; &parms[i][j]; ++j) {
                                if (parms[i][j] == '(') ++paren_nest;
                                if (parms[i][j] == ')') --paren_nest;
                        }
@@ -351,7 +351,7 @@ void imap_list(int num_parms, char *parms[])
                extended_list_in_use = 1;
                paren_nest = 0;
                for (i=return_left; i<num_parms; ++i) {
-                       for (j=0; j<strlen(parms[i]); ++j) {
+                       for (j=0; parms[i][j]; ++j) {
                                if (parms[i][j] == '(') ++paren_nest;
                                if (parms[i][j] == ')') --paren_nest;
                        }
@@ -395,7 +395,7 @@ void imap_list(int num_parms, char *parms[])
         * hierarchy delimiter and the root name of the name given in the
         * reference parameter.
         */
-       if ( (strlen(patterns[0]) == 0) && (extended_list_in_use == 0) ) {
+       if ( (IsEmptyStr(patterns[0])) && (extended_list_in_use == 0) ) {
                cprintf("* %s (\\Noselect) \"/\" \"\"\r\n", verb);
        }