Skip to content

Commit

Permalink
Merge pull request #2302 from atomex-me/master
Browse files Browse the repository at this point in the history
Thanks @matsakiv
  • Loading branch information
mbdavid authored Jul 20, 2023
2 parents c96a393 + 734515a commit e69fb2b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions LiteDB/Engine/Sort/SortDisk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,11 @@ public void Write(long position, BufferSlice buffer)
// there is only a single writer instance, must be lock to ensure only 1 single thread are writing
lock(writer)
{
writer.Position = position;
writer.Write(buffer.Array, buffer.Offset, _containerSize);
for (var i = 0; i < _containerSize / PAGE_SIZE; ++i)
{
writer.Position = position + i * PAGE_SIZE;
writer.Write(buffer.Array, buffer.Offset + i * PAGE_SIZE, PAGE_SIZE);
}
}
}

Expand Down

0 comments on commit e69fb2b

Please sign in to comment.