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 bbfc064 commit a1fb6f1Copy full SHA for a1fb6f1
stdlib/public/core/Sequence.swift
@@ -906,8 +906,7 @@ extension Sequence {
906
ringBuffer.append(element)
907
} else {
908
ringBuffer[i] = element
909
- i += 1
910
- i %= maxLength
+ i = (i + 1) % maxLength
911
}
912
913
@@ -986,8 +985,7 @@ extension Sequence {
986
985
987
result.append(ringBuffer[i])
988
989
990
- i %= k
+ i = (i + 1) % k
991
992
993
return result
0 commit comments