mirror of
https://gitlab.com/manzerbredes/chess-move-interface.git
synced 2025-05-10 17:40:56 +00:00
Improve parsing data type
This commit is contained in:
parent
0fa6b682f5
commit
f144f14d9c
8 changed files with 45 additions and 28 deletions
|
@ -23,7 +23,7 @@ void LargeFileStream::ReadNextChunk() {
|
|||
last_read_size = file.gcount();
|
||||
}
|
||||
|
||||
char LargeFileStream::operator[](long loc) {
|
||||
char LargeFileStream::operator[](ull loc) {
|
||||
// Perform various checks
|
||||
if (eof) {
|
||||
throw ReadToFar();
|
||||
|
@ -42,11 +42,11 @@ char LargeFileStream::operator[](long loc) {
|
|||
}
|
||||
|
||||
// Goto the right memory chuck
|
||||
long loc_chunk_count = loc / BUFFER_SIZE;
|
||||
ull loc_chunk_count = loc / BUFFER_SIZE;
|
||||
while (chuck_count < loc_chunk_count) {
|
||||
ReadNextChunk();
|
||||
}
|
||||
long offset = loc - (loc_chunk_count * BUFFER_SIZE);
|
||||
ull offset = loc - (loc_chunk_count * BUFFER_SIZE);
|
||||
|
||||
// Ensure for EOF
|
||||
if (!file && offset >= last_read_size) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue