提交 9098afe1 authored 作者: Thomas Mueller's avatar Thomas Mueller

Speedup

上级 7528244f
...@@ -122,8 +122,10 @@ public class FileObjectMemory implements FileObject { ...@@ -122,8 +122,10 @@ public class FileObjectMemory implements FileObject {
return; return;
} }
byte[] out = new byte[BLOCK_SIZE]; byte[] out = new byte[BLOCK_SIZE];
synchronized (LZF) { if (d != COMPRESSED_EMPTY_BLOCK) {
LZF.expand(d, 0, d.length, out, 0, BLOCK_SIZE); synchronized (LZF) {
LZF.expand(d, 0, d.length, out, 0, BLOCK_SIZE);
}
} }
data[page] = out; data[page] = out;
} }
...@@ -192,7 +194,6 @@ public class FileObjectMemory implements FileObject { ...@@ -192,7 +194,6 @@ public class FileObjectMemory implements FileObject {
} }
data = n; data = n;
} }
} }
private void readWrite(byte[] b, int off, int len, boolean write) throws IOException { private void readWrite(byte[] b, int off, int len, boolean write) throws IOException {
......
...@@ -76,10 +76,7 @@ public class FileSystemMemory extends FileSystem { ...@@ -76,10 +76,7 @@ public class FileSystemMemory extends FileSystem {
} }
public boolean tryDelete(String fileName) { public boolean tryDelete(String fileName) {
fileName = normalize(fileName); delete(fileName);
synchronized (MEMORY_FILES) {
MEMORY_FILES.remove(fileName);
}
return true; return true;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论