Skip to content

Commit

Permalink
glusterd-op-sm.c (and others) - improve glusterd_op_stage_set_volume()
Browse files Browse the repository at this point in the history
Multiple changes to the function in the hope to make it somewhat faster.
1. Checking for key length against constant strings before calling
strcmp() to save some calls.
2. Verifying if a match was already made against the key to reduce
yet more checks.
3. Alignment of error message when they can fit on less lines - just
makes 'grep' on the code for error messages easier and it's more
readable.
4. Multiple functions where call _gd_get_vmep() one by one.
Instead, extracted it to be callable (it was static) and re-used
its result, instead of calling it again and again.
5. Removed some unneeded include statement.
6. Removed redundant null checks.

Hopefully, no functional changes.

Change-Id: Id281224e49adeca6757f96653b4cb13c7c9ba8c9
updates: bz#1193929
Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
  • Loading branch information
Yaniv Kaul authored and gluster-ant committed Nov 3, 2019
1 parent 9c96b89 commit e081ac6
Show file tree
Hide file tree
Showing 5 changed files with 219 additions and 306 deletions.
Loading

0 comments on commit e081ac6

Please sign in to comment.