Skip to content

Commit

Permalink
Merge pull request #2766 from scala-steward/update/scalafmt-core-3.2.2
Browse files Browse the repository at this point in the history
Update scalafmt-core to 3.2.2
mpilquist authored Dec 24, 2021

Verified

This commit was signed with the committer’s verified signature.
Sonicadvance1 Ryan Houdek
2 parents 0c787f1 + a423d27 commit 2e0481a
Showing 3 changed files with 30 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.2.1"
version = "3.2.2"

style = default

14 changes: 8 additions & 6 deletions core/shared/src/main/scala/fs2/Pull.scala
Original file line number Diff line number Diff line change
@@ -997,12 +997,14 @@ object Pull extends PullLowPriority {
if (idx == chunk.size)
flatMapOutput[G, G, Y, X](tail, fun)
else {
try transformWith(fun(chunk(idx))) {
case Succeeded(_) => go(idx + 1)
case Fail(err) => Fail(err)
case interruption @ Interrupted(_, _) =>
flatMapOutput[G, G, Y, X](interruptBoundary(tail, interruption), fun)
} catch { case NonFatal(e) => Fail(e) }
try
transformWith(fun(chunk(idx))) {
case Succeeded(_) => go(idx + 1)
case Fail(err) => Fail(err)
case interruption @ Interrupted(_, _) =>
flatMapOutput[G, G, Y, X](interruptBoundary(tail, interruption), fun)
}
catch { case NonFatal(e) => Fail(e) }
}

go(0)
Original file line number Diff line number Diff line change
@@ -314,28 +314,30 @@ private[net] object AsynchronousDatagramSocketGroup {
selectedKeys.remove
val channel = key.channel.asInstanceOf[DatagramChannel]
val attachment = key.attachment.asInstanceOf[Attachment]
try if (key.isValid) {
if (key.isReadable) {
var success = true
while (success && attachment.hasReaders) {
val reader = attachment.peekReader.get
success = read1(channel, reader)
if (success) attachment.dequeueReader
try
if (key.isValid) {
if (key.isReadable) {
var success = true
while (success && attachment.hasReaders) {
val reader = attachment.peekReader.get
success = read1(channel, reader)
if (success) attachment.dequeueReader
}
}
}
if (key.isWritable) {
var success = true
while (success && attachment.hasWriters) {
val (p, writer) = attachment.peekWriter.get
success = write1(channel, p, writer)
if (success) attachment.dequeueWriter
if (key.isWritable) {
var success = true
while (success && attachment.hasWriters) {
val (p, writer) = attachment.peekWriter.get
success = write1(channel, p, writer)
if (success) attachment.dequeueWriter
}
}
key.interestOps(
(if (attachment.hasReaders) SelectionKey.OP_READ else 0) |
(if (attachment.hasWriters) SelectionKey.OP_WRITE else 0)
)
}
key.interestOps(
(if (attachment.hasReaders) SelectionKey.OP_READ else 0) |
(if (attachment.hasWriters) SelectionKey.OP_WRITE else 0)
)
} catch {
catch {
case _: CancelledKeyException => // Ignore; key was closed
}
}

0 comments on commit 2e0481a

Please sign in to comment.