[Devel] [PATCH] RFC: rewrite lots of strcmps at array lookup

Igor M Podlesny openvz at poige.ru
Thu May 9 12:01:41 PDT 2013


On 10 May 2013 02:54, Igor Podlesny <openvz at poige.ru> wrote:
> ---
>  src/vzctl.c |  149 ++++++++++++++++++++++++++++++++---------------------------
>  1 file changed, 80 insertions(+), 69 deletions(-)

   I think about using some macro for making look-up array entry like:

ACTION_ENTRY(CREATE, cb_init_modules)
ACTION_ENTRY(RESTART, NULL)

   which would have expanded to entries

"CREATE", ACTION_CREATE, cb_init_modules
"RESTART", ACTION_RESTART, NULL

   and the only issue with it is having to use uppercase strings and
hence either ignoring case string comparison or strlower()ing entry
before comparsion -- not sure but tending to strlower.

--



More information about the Devel mailing list