[tablet] one less memory allocation in CBTree::count()

While reviewing [1], I noticed there is room for improvement in CBTree.
One trivial one is avoiding calls to 'new' when an object might be
allocated on the stack.  This makes sense since in some intensive Kudu
workloads we might see significant lock contention in tcmalloc, and
removing needless calls to 'new' helps to relieve that, even if it's
not in the hot path.

[1] https://gerrit.cloudera.org/#/c/21127/

Change-Id: I01a68e0427b399db92b33c910185654d195150a5
Reviewed-on: http://gerrit.cloudera.org:8080/21276
Reviewed-by: Yingchun Lai <laiyingchun@apache.org>
Reviewed-by: Yifan Zhang <chinazhangyifan@163.com>
Tested-by: Alexey Serbin <alexey@apache.org>
1 file changed