]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd/ECExtentCache: eliminate redundant map lookups 64063/head
authorKefu Chai <tchaikov@gmail.com>
Fri, 20 Jun 2025 09:00:59 +0000 (17:00 +0800)
committerKefu Chai <tchaikov@gmail.com>
Fri, 20 Jun 2025 10:00:49 +0000 (18:00 +0800)
commitf4118f892488cd2ca83ff908f092b5cd4ad82257
tree4a252b680029e73dcc1faad4cca69fb538a12425
parentc9da5b8464601ae2d368175c4f0d43f04371b397
osd/ECExtentCache: eliminate redundant map lookups

Replace contains() + at() pattern with single find() call to avoid
double lookup overhead. Previously checked map.contains(key) then
used map.at(key), which performs two hash table lookups for the
same operation.

Now uses map.find() and checks the returned iterator against end(),
accessing the value directly from the iterator when found.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/osd/ECExtentCache.cc