ibireme / YYCache

High performance cache framework for iOS.
MIT License
2.38k stars 515 forks source link

YYDiskCache通过YYKVStorageTypeFile存储,为什么不单单写入文件 还通过SQLite存储了数据 #128

Closed iStig closed 6 years ago

iStig commented 6 years ago

if (filename.length) { if (![self _fileWriteWithName:filename data:value]) {//写入文件 return NO; } if (![self _dbSaveWithKey:key value:value fileName:filename extendedData:extendedData]) {////写入sqlite [self _fileDeleteWithName:filename]; return NO; } return YES; }

iStig commented 6 years ago

发现问题了
if (fileName.length == 0) { sqlite3_bind_blob(stmt, 4, value.bytes, (int)value.length, 0); } else { sqlite3_bind_blob(stmt, 4, NULL, 0, 0); }