We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f211d01 commit 91ff835Copy full SHA for 91ff835
stdlib/public/core/Sequence.swift
@@ -901,8 +901,7 @@ extension Sequence {
901
ringBuffer.append(element)
902
} else {
903
ringBuffer[i] = element
904
- i += 1
905
- i %= maxLength
+ i = (i + 1) % maxLength
906
}
907
908
@@ -978,8 +977,7 @@ extension Sequence {
978
977
979
result.append(ringBuffer[i])
980
981
982
- i %= k
+ i = (i + 1) % k
983
984
985
return Array(result)
0 commit comments