Skip to content

Commit 40be3c6

Browse files
authored
Call discardReadBytes instead of slice, which cleans up memory (#366)
1 parent 2fbf3f0 commit 40be3c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/MongoKitten/GridFS/GridFSFileWriter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,6 @@ public final class GridFSFileWriter {
218218
}
219219

220220
// Trim the buffer to the current size
221-
buffer = buffer.slice()
221+
buffer.discardReadBytes()
222222
}
223223
}

0 commit comments

Comments
 (0)