Skip to content

Commit 11b804a

Browse files
committed
Cleanup
1 parent 32d4bf4 commit 11b804a

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

TACTSharp/CDN.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ public async Task<string> GetPatchServiceFile(string product, string file = "ver
184184
return File.ReadAllBytes(cachePath);
185185
}
186186

187-
var success = false;
188187
for (var i = 0; i < CDNServers.Count; i++)
189188
{
190189
var url = $"http://{CDNServers[i]}/{ProductDirectory}/{type}/{hash[0]}{hash[1]}/{hash[2]}{hash[3]}/{hash}";
@@ -223,10 +222,7 @@ public async Task<string> GetPatchServiceFile(string product, string file = "ver
223222
return File.ReadAllBytes(cachePath);
224223
}
225224

226-
if (!success)
227-
throw new FileNotFoundException("Exhausted all CDNs trying to download " + hash);
228-
229-
return null;
225+
throw new FileNotFoundException("Exhausted all CDNs trying to download " + hash);
230226
}
231227

232228
public unsafe bool TryGetLocalFile(string eKey, out ReadOnlySpan<byte> data)
@@ -313,7 +309,6 @@ public unsafe bool TryGetLocalFile(string eKey, out ReadOnlySpan<byte> data)
313309
}
314310
}
315311

316-
var success = false;
317312
for (var i = 0; i < CDNServers.Count; i++)
318313
{
319314
var url = $"http://{CDNServers[i]}/{ProductDirectory}/data/{archive[0]}{archive[1]}/{archive[2]}{archive[3]}/{archive}";
@@ -358,10 +353,7 @@ public unsafe bool TryGetLocalFile(string eKey, out ReadOnlySpan<byte> data)
358353
return File.ReadAllBytes(cachePath);
359354
}
360355

361-
if (!success)
362-
throw new FileNotFoundException("Exhausted all CDNs trying to download " + eKey + " (archive " + archive + ")");
363-
364-
return null;
356+
throw new FileNotFoundException("Exhausted all CDNs trying to download " + eKey + " (archive " + archive + ")");
365357
}
366358

367359
public byte[] GetFile(string type, string hash, ulong compressedSize = 0, ulong decompressedSize = 0, bool decoded = false, CancellationToken token = new())

0 commit comments

Comments
 (0)