Change data compare statement when do animated data comparation
This commit is contained in:
parent
759b7322c9
commit
3dc5b0ab67
|
@ -637,9 +637,9 @@ static NSUInteger SDDeviceFreeMemory() {
|
||||||
// If current data is the same data (or instance) as previous data
|
// If current data is the same data (or instance) as previous data
|
||||||
self.isProgressive = YES;
|
self.isProgressive = YES;
|
||||||
} else if (currentData.length > previousData.length) {
|
} else if (currentData.length > previousData.length) {
|
||||||
// If current data is appended by previous data, use `NSDataSearchAnchored`
|
// If current data is appended by previous data, use `NSDataSearchAnchored`, search is limited to start of currentData
|
||||||
NSRange range = [currentData rangeOfData:previousData options:NSDataSearchAnchored range:NSMakeRange(0, previousData.length)];
|
NSRange range = [currentData rangeOfData:previousData options:NSDataSearchAnchored range:NSMakeRange(0, previousData.length)];
|
||||||
if (range.location == 0) {
|
if (range.location != NSNotFound) {
|
||||||
// Contains hole previous data and they start with the same beginning
|
// Contains hole previous data and they start with the same beginning
|
||||||
self.isProgressive = YES;
|
self.isProgressive = YES;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue