mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-20 10:23:30 -04:00
#1351 added foreachIndexed
This commit is contained in:
parent
d2daf9f7c4
commit
499b76a0d3
@ -59,9 +59,7 @@ internal class SenderDevice(
|
||||
val hostAddress =
|
||||
wifiDirectManager.getFileReceiverDeviceAddress().hostAddress
|
||||
var isTransferErrorFree = true
|
||||
var fileIndex = 0
|
||||
while (fileIndex < fileItems.size && this.isActive) {
|
||||
val fileItem = fileItems[fileIndex]
|
||||
fileItems.forEachIndexed { fileIndex, fileItem ->
|
||||
try {
|
||||
Socket().use { socket ->
|
||||
Log.d("gouri", "${Thread.currentThread().name} thread")
|
||||
@ -85,7 +83,6 @@ internal class SenderDevice(
|
||||
isTransferErrorFree = false
|
||||
publishProgress(fileIndex, FileItem.FileStatus.ERROR)
|
||||
}
|
||||
fileIndex++
|
||||
}
|
||||
return@withContext isTransferErrorFree
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user