Joe Conway <[EMAIL PROTECTED]> writes: > /* Make a modifiable copy of the input */ > ! string_save = (char *) palloc0(strlen(string) + 1); > strcpy(string_save, string);
palloc0, instead of palloc, is clearly a waste of cycles here ... actually, why isn't this just a pstrdup? > /* special case for an empty array */ > ! if (strlen(str) == 2 && strncmp(str, "{}", 2) == 0) > return 0; Why not just if (strcmp(str, "{}") == 0) Looks reasonable otherwise. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org