pgbench - use enum for meta commands

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: pgbench - use enum for meta commands
Date: 2017-09-23 03:45:35
Message-ID: alpine.DEB.2.20.1709230538130.4999@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Minor code enhancement.

While having a look at adding if/elif/else/endif to pgbench, and given the
current gset/cset added meta commands in cf queue, it occured to me that
repeated string comparisons to check for the various meta commands is
neither efficient nor readable. Use an enum instead, which are extensively
used already for other similar purposes.

--
Fabien.

Attachment Content-Type Size
pgbench-enum-meta-1.patch text/x-diff 4.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-09-23 03:56:38 Re: CREATE COLLATION does not sanitize ICU's BCP 47 language tags. Should it?
Previous Message Tom Lane 2017-09-23 03:19:52 Re: BUG #14825: enum type: unsafe use?