Skip to content

Commit 82e6cea

Browse files
charagarlnadasiekierka
authored andcommitted
use buffer in LuaStateFactory file comparison (#137)
1 parent d19255d commit 82e6cea

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/scala/li/cil/oc/server/machine/luac/LuaStateFactory.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package li.cil.oc.server.machine.luac
22

3+
import java.io.BufferedInputStream
34
import java.io.File
45
import java.io.FileInputStream
56
import java.io.FileOutputStream
@@ -242,8 +243,8 @@ abstract class LuaStateFactory {
242243
if (tmpLibFile.exists()) {
243244
var matching = true
244245
try {
245-
val inCurrent = libraryUrl.openStream()
246-
val inExisting = new FileInputStream(tmpLibFile)
246+
val inCurrent = new BufferedInputStream(libraryUrl.openStream())
247+
val inExisting = new BufferedInputStream(new FileInputStream(tmpLibFile))
247248
var inCurrentByte = 0
248249
var inExistingByte = 0
249250
do {

0 commit comments

Comments
 (0)