git: sbin/hammer: Refactor left/right boundary elms in hammer show
Tomohiro Kusumi
tkusumi at crater.dragonflybsd.org
Fri Nov 11 23:08:42 PST 2016
commit f3c08aaa8e4136d3fd66e2caa7fe45489372f481
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date: Sat Nov 12 13:11:10 2016 +0900
sbin/hammer: Refactor left/right boundary elms in hammer show
hammer show doesn't need to pass around pointers to left/right
boundary elms in every function while walking the B-Tree.
Left/right elms are there to test whether a B-Tree node in
question fits in boundaries defined by its parent, which means
that hammer show always requires the right elm be (left+1), but
not some random elm after the left elm. Because of this, it
only needs to pass around the left elm.
The code is more efficient plus look better without bunch of
left/right stuff.
Summary of changes:
sbin/hammer/cmd_show.c | 89 ++++++++++++++++++++------------------------------
1 file changed, 35 insertions(+), 54 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f3c08aaa8e4136d3fd66e2caa7fe45489372f481
--
DragonFly BSD source repository
More information about the Commits
mailing list