From: Ivailo Monev Date: Sat, 30 Nov 2019 03:02:38 +0000 (+0000) Subject: move some inline methods body to their declaration in QCache X-Git-Tag: 4.12.0~4922 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2efe200ad77d59a57f29e38a397fc4273cedfe2a;p=kde%2FKatie.git move some inline methods body to their declaration in QCache Signed-off-by: Ivailo Monev --- diff --git a/src/core/tools/qcache.h b/src/core/tools/qcache.h index 5934e1856..cf4154ef6 100644 --- a/src/core/tools/qcache.h +++ b/src/core/tools/qcache.h @@ -64,16 +64,18 @@ public: inline bool insert(const Key &key, T *object, int cost = 1); inline T *object(const Key &key) const { return hash.value(key, Q_NULLPTR); } inline bool contains(const Key &key) const { return hash.contains(key); } - inline T *operator[](const Key &key) const; + inline T *operator[](const Key &key) const { return object(key); } - inline bool remove(const Key &key); - inline T *take(const Key &key); + inline bool remove(const Key &key) { return hash.remove(key) != 0; } + inline T *take(const Key &key) { return hash.take(key); } }; template inline QCache::QCache(int amaxCost) : mx(amaxCost) -{ hash.reserve(amaxCost); } +{ + hash.reserve(amaxCost); +} template inline void QCache::setMaxCost(int m) @@ -84,20 +86,6 @@ inline void QCache::setMaxCost(int m) } template -inline T *QCache::operator[](const Key &key) const -{ return object(key); } - -template -inline bool QCache::remove(const Key &key) -{ return hash.remove(key) != 0; } - -template -inline T *QCache::take(const Key &key) -{ - return hash.take(key); -} - -template inline bool QCache::insert(const Key &akey, T *aobject, int acost) { if (acost > mx) {