]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
os/KeyValueDB: don't call self.valid() from next() and prev()
authorPiotr Dałek <piotr.dalek@ts.fujitsu.com>
Mon, 19 Oct 2015 06:32:10 +0000 (08:32 +0200)
committerSage Weil <sage@redhat.com>
Mon, 9 Nov 2015 14:03:22 +0000 (09:03 -0500)
commit117f40c6905fab15148c516e66759148a60f3cfa
tree53f827b4d78f2fe0cadf35a777e6ebaf2b7b43ff
parent66b7b920cf5a0a9c71212573ef47fb2c7ea9b5ff
os/KeyValueDB: don't call self.valid() from next() and prev()

In most loops using ObjectMapIteratorImpl, there is a call to valid()
followed by a call to next(), which calls valid() again. Calling
valid() alone is particularly expensive, so don't do it twice if
possible.

Signed-off-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
src/kv/KeyValueDB.h
src/os/DBObjectMap.cc
src/os/DBObjectMap.h
src/os/GenericObjectMap.cc
src/os/GenericObjectMap.h
src/os/MemStore.h
src/os/newstore/NewStore.cc
src/os/newstore/NewStore.h