Re: [PATCH 5/6] psql: print_aligned_text uses table formatting
От | Roger Leigh |
---|---|
Тема | Re: [PATCH 5/6] psql: print_aligned_text uses table formatting |
Дата | |
Msg-id | 20090823164316.GA30750@codelibre.net обсуждение исходный текст |
Ответ на | [PATCH 1/6] psql: Abstract table formatting characters used for different line types. (Roger Leigh <rleigh@debian.org>) |
Ответы |
Re: [PATCH 5/6] psql: print_aligned_text uses table
formatting
|
Список | pgsql-hackers |
On Sun, Aug 23, 2009 at 11:47:02AM -0400, Alvaro Herrera wrote: > 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? It's certainly possible to change it; the above might be slightly more efficient than a call to fprintf since you skip parsing the format string, but otherwise I have no real preference for one over the other. Regards, Roger -- .''`. Roger Leigh: :' : Debian GNU/Linux http://people.debian.org/~rleigh/`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/ `- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
В списке pgsql-hackers по дате отправления: