]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/ECExtentCache: convert LRU::Key from class to struct
authorKefu Chai <tchaikov@gmail.com>
Fri, 20 Jun 2025 07:56:26 +0000 (15:56 +0800)
committerKefu Chai <tchaikov@gmail.com>
Fri, 20 Jun 2025 10:00:49 +0000 (18:00 +0800)
Change Key from a class with public members and constructor to a
plain struct. Since Key only holds data with no special initialization
logic, a struct with aggregate initialization is more appropriate
and simpler.

This removes the user-declared constructor and relies on the compiler's
default aggregate initialization from initializer lists.

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

index 0198cb331cda4e08a4967e0b7fe7d163eb5090ec..7945c507bf212cfbea414f2ff647e75235c65c4c 100644 (file)
@@ -104,13 +104,9 @@ class ECExtentCache {
 
   class LRU {
    public:
-    class Key {
-     public:
+    struct Key {
       uint64_t offset;
       hobject_t oid;
-
-      Key(uint64_t offset, const hobject_t &oid) : offset(offset), oid(oid) {};
-
       bool operator==(const Key&) const = default;
     };