Skip to content

Commit

Permalink
Reformat with scalafmt 3.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
scala-steward committed Dec 23, 2021
1 parent 585f7dd commit a423d27
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 25 deletions.
14 changes: 8 additions & 6 deletions core/shared/src/main/scala/fs2/Pull.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit a423d27

Please sign in to comment.