Skip to content

Commit

Permalink
use buffer in LuaStateFactory file comparison (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
charagarlnad authored and asiekierka committed Jan 4, 2025
1 parent d19255d commit 82e6cea
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package li.cil.oc.server.machine.luac

import java.io.BufferedInputStream
import java.io.File
import java.io.FileInputStream
import java.io.FileOutputStream
Expand Down Expand Up @@ -242,8 +243,8 @@ abstract class LuaStateFactory {
if (tmpLibFile.exists()) {
var matching = true
try {
val inCurrent = libraryUrl.openStream()
val inExisting = new FileInputStream(tmpLibFile)
val inCurrent = new BufferedInputStream(libraryUrl.openStream())
val inExisting = new BufferedInputStream(new FileInputStream(tmpLibFile))
var inCurrentByte = 0
var inExistingByte = 0
do {
Expand Down

0 comments on commit 82e6cea

Please sign in to comment.