Re: [PATCH 5/6] psql: print_aligned_text uses table formatting - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [PATCH 5/6] psql: print_aligned_text uses table formatting
Date
Msg-id 20090823154702.GA5287@alvh.no-ip.org
Whole thread Raw
In response to [PATCH 5/6] psql: print_aligned_text uses table formatting  (Roger Leigh <rleigh@debian.org>)
List pgsql-hackers
Roger Leigh wrote:
> Convert print_aligned_text, and its helper function, to use
> table formatting in place of hardcoded ASCII characters.

> @@ -841,7 +856,10 @@ print_aligned_text(const printTableContent *cont, const printTextFormat *format,
>  
>              /* left border */
>              if (opt_border == 2)
> -                fputs("| ", fout);
> +            {
> +                fputs(format->vrule, fout);
> +                fputc(' ', fout);
> +            }
>              else if (opt_border == 1)
>                  fputc(' ', fout);

Wouldn't it be better to do a single fprintf call here instead of
fputc + fputs?

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Grzegorz Jaskiewicz
Date:
Subject: Re: clang's static checker report.
Next
From: Grzegorz Jaskiewicz
Date:
Subject: Re: clang's static checker report.