Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Small naming refactor

  • Loading branch information...
commit 71d7dc690cb627477efae13acfbdd27f65029bc1 1 parent abeafc3
@JaviSoto JaviSoto authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 Zinc/ZincDownloadTask.m
View
7 Zinc/ZincDownloadTask.m
@@ -46,8 +46,11 @@ - (ZincHTTPRequestOperation *) queuedOperationForRequest:(NSURLRequest *)request
NSTimeInterval timeSinceLastEventSent = currentDate - lastTimeEventSentDate;
- // Decrease the ammount of events sent by only sending significant value changes with a minimum time offset
- if (newProgressRounded != lastNotifiedProgressRounded && timeSinceLastEventSent >= minTimeOffsetBetweenEventSends)
+ BOOL progressIncreasedSinceLastNotification = newProgressRounded != lastNotifiedProgressRounded;
+ BOOL enoughTimePassedSinceLastNotification = timeSinceLastEventSent >= minTimeOffsetBetweenEventSends;
+
+ // Decrease the amount of events sent by only sending significant value changes with a minimum time offset
+ if (progressIncreasedSinceLastNotification && enoughTimePassedSinceLastNotification)
{
lastNotifiedProgressRounded = newProgressRounded;
lastTimeEventSentDate = currentDate;
Please sign in to comment.
Something went wrong with that request. Please try again.