/*
- * Copyright (c) 2014-2020 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2014-2021 Samsung Electronics Co., Ltd. All rights reserved.
*
* This file is licensed under the terms of MIT License or the Apache License
* Version 2.0 of your choice. See the LICENSE.MIT file for MIT license details.
if (m_capacity > 0) {
std::string cacheKey = keyToString(key);
- auto resultIt = m_keyValue.find(cacheKey);
if (plugin->isCacheable(session, storedResult)) {
LOGD("Entry cacheable");
if (m_keyValue.size() == m_capacity) {
}
//Move value usage to front
+ auto resultIt = m_keyValue.find(cacheKey);
if (resultIt != m_keyValue.end()) {
auto usageIt = std::get<2>(resultIt->second);
m_keyUsage.splice(m_keyUsage.begin(), m_keyUsage, usageIt);
m_keyValue[cacheKey] = std::make_tuple(storedResult, session, m_keyUsage.begin());
} else {
//Remove element
+ auto resultIt = m_keyValue.find(cacheKey);
if (resultIt != m_keyValue.end()) {
auto usageIt = std::get<2>(resultIt->second);
m_keyUsage.erase(usageIt);