Simplify code

See gh-18342
This commit is contained in:
Yuyan
2019-09-26 19:09:28 -07:00
committed by Phillip Webb
parent a0957d9bba
commit 4d0da4b700
2 changed files with 3 additions and 10 deletions

View File

@@ -143,8 +143,8 @@ class BootArchiveSupport {
}
private boolean isZip(InputStream inputStream) throws IOException {
for (int i = 0; i < ZIP_FILE_HEADER.length; i++) {
if (inputStream.read() != ZIP_FILE_HEADER[i]) {
for (byte b : ZIP_FILE_HEADER) {
if (inputStream.read() != b) {
return false;
}
}