Commit 43fb962b authored by Chen Bill's avatar Chen Bill

DataManager: GetData() use reference

parent 2df78392
...@@ -152,10 +152,10 @@ bool DataManager::Error(spmemvfs_db_t* pDB, sqlite3_stmt* pStmt) { ...@@ -152,10 +152,10 @@ bool DataManager::Error(spmemvfs_db_t* pDB, sqlite3_stmt* pStmt) {
return false; return false;
} }
bool DataManager::GetData(unsigned int code, CardData* pData) { bool DataManager::GetData(unsigned int code, CardData* pData) {
auto cdit = _datas.find(code); code_pointer cdit = _datas.find(code);
if(cdit == _datas.end()) if(cdit == _datas.end())
return false; return false;
auto data = cdit->second; auto& data = cdit->second;
if (pData) { if (pData) {
pData->code = data.code; pData->code = data.code;
pData->alias = data.alias; pData->alias = data.alias;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment