diff options
author | Allen Winter <allen.winter@kdab.com> | 2019-04-08 17:43:42 -0400 |
---|---|---|
committer | Allen Winter <allen.winter@kdab.com> | 2019-04-08 17:43:42 -0400 |
commit | 9043851e8bd0cf1eca3d62d1678257c953201c9d (patch) | |
tree | a9e3eb2121b7ea2b44e9adc263e9064572ede3a6 | |
parent | 85aab8690b1fef49ad460b4a167d0602a718a531 (diff) | |
parent | ca274e3f394c29099439fe47c78be4dab0ad9b67 (diff) | |
download | libical-git-9043851e8bd0cf1eca3d62d1678257c953201c9d.tar.gz |
Merge branch 'tapkey-iterator-performance-next_year'
-rw-r--r-- | src/libical/icalrecur.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libical/icalrecur.c b/src/libical/icalrecur.c index 735c28df..f7a65e66 100644 --- a/src/libical/icalrecur.c +++ b/src/libical/icalrecur.c @@ -2681,7 +2681,7 @@ static int next_year(icalrecur_iterator *impl) return next_yearday(impl, &__next_year); } -static void daymask_find_next_bit(unsigned long days[], short* p_days_index) { +static void daymask_find_next_bit(unsigned long days[], short *p_days_index) { unsigned long v; short startBitIndex; @@ -2692,7 +2692,7 @@ static void daymask_find_next_bit(unsigned long days[], short* p_days_index) { // Prepare the first word, where searching might not start at the beginning startBitIndex = *p_days_index + ICAL_YEARDAYS_MASK_OFFSET; - wordIdx = startBitIndex / BITS_PER_LONG; + wordIdx = (int)(startBitIndex / BITS_PER_LONG); v = days[wordIdx]; v >>= startBitIndex % BITS_PER_LONG; @@ -2719,13 +2719,12 @@ static void daymask_find_next_bit(unsigned long days[], short* p_days_index) { // position yet. Do a b-search to find it. unsigned long mask; - int maskSize = BITS_PER_LONG / 2; + int maskSize = (int)(BITS_PER_LONG / 2); mask = (((unsigned long)1) << maskSize) - 1; while (maskSize) { - if ((v & mask) == 0) - { + if ((v & mask) == 0) { v >>= maskSize; *p_days_index += maskSize; } |