Skip to content

Commit bb39327

Browse files
committed
Remove unnecessary fields from minimal cache
Lessen memory requirement: these enclosure informations will be required (and retrieved from database) only when we display articles of folder. Minimal cache is only used as a proxy marking if an article is (or isn't) present in database, (un)read, (un)flagged, (un)deleted or revised.
1 parent b7daed7 commit bb39327

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Vienna/Sources/Database/Database.m

+1-5
Original file line numberDiff line numberDiff line change
@@ -2005,7 +2005,7 @@ -(NSArray *)minimalCacheForFolder:(NSInteger)folderId
20052005

20062006
FMDatabaseQueue *queue = self.databaseQueue;
20072007
[queue inDatabase:^(FMDatabase *db) {
2008-
FMResultSet * results = [db executeQueryWithFormat:@"SELECT message_id, read_flag, marked_flag, deleted_flag, title, link, revised_flag, hasenclosure_flag, enclosure FROM messages WHERE folder_id=%ld", (long)folderId];
2008+
FMResultSet * results = [db executeQueryWithFormat:@"SELECT message_id, read_flag, marked_flag, deleted_flag, title, link, revised_flag FROM messages WHERE folder_id=%ld", (long)folderId];
20092009
while ([results next]) {
20102010
NSString * guid = [results stringForColumnIndex:0];
20112011
BOOL read_flag = [results stringForColumnIndex:1].integerValue;
@@ -2014,8 +2014,6 @@ -(NSArray *)minimalCacheForFolder:(NSInteger)folderId
20142014
NSString * title = [results stringForColumnIndex:4];
20152015
NSString * link = [results stringForColumnIndex:5];
20162016
BOOL revised_flag = [results stringForColumnIndex:6].integerValue;
2017-
BOOL hasenclosure_flag = [results stringForColumnIndex:7].integerValue;
2018-
NSString * enclosure = [results stringForColumnIndex:8];
20192017

20202018
// Keep our own track of unread articles
20212019
if (!read_flag) {
@@ -2030,8 +2028,6 @@ -(NSArray *)minimalCacheForFolder:(NSInteger)folderId
20302028
article.folderId = folderId;
20312029
article.title = title;
20322030
article.link = link;
2033-
article.enclosure = enclosure;
2034-
article.hasEnclosure = hasenclosure_flag;
20352031
[myCache addObject:article];
20362032
}
20372033
[results close];

0 commit comments

Comments
 (0)